D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 22934 - Header generator emits context pointer as `this`
Summary: Header generator emits context pointer as `this`
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2022-03-25 15:05 UTC by moonlightsentinel
Modified: 2022-03-27 05:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description moonlightsentinel 2022-03-25 15:05:00 UTC
The header generator prints the name of the implicitly generated member that represents the context pointer as `this` which is obviously not a valid identifier.

e.g.

--- example.d
extern(C++) class Outer
{
    class Inner
    {

    }
}

--- example.h
class Outer
{
public:
    class Inner
    {
    public:
        Outer* outer;
    };

};
Comment 1 Dlang Bot 2022-03-25 15:06:29 UTC
@MoonlightSentinel created dlang/dmd pull request #13887 "Fix 22934 - Emit context pointer as `this` instead of `this`" fixing this issue:

- Fix 22934 - Emit context pointer as `this` instead of `this`
  
  Because the latter is obviosly not a valid identifier.

https://github.com/dlang/dmd/pull/13887
Comment 2 Dlang Bot 2022-03-27 05:10:19 UTC
dlang/dmd pull request #13887 "Fix 22934 - Emit context pointer as `outer` instead of `this`" was merged into master:

- cd1017c7e2aed79f5484d4eca93313b60ba40de6 by MoonlightSentinel:
  Fix 22934 - Emit context pointer as `outer` instead of `this`
  
  Because the latter is obviosly not a valid identifier.

https://github.com/dlang/dmd/pull/13887