-
Notifications
You must be signed in to change notification settings - Fork 261
[BUG] Declaring a type named struct
or class
#394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
struct
or class
struct
or class
It was 1886ed2#diff-e683e1259bbc0d6de7f1fbf797fb772f31a0a1ef2254ec317d15c298102fa3f3R1551-R1552 which made |
Thanks! |
https://godbolt.org/z/c6vv9zGxz still doesn't work. - public: and(and const& that);
+ public: cpp2_and(and const& that); |
Ah, my bad -- fixed. I had verified it was working, but then temporarily backed out a couple of the fixed places to debug some Cpp1 formatting artifacts, and forgot to re-enable them (including to re-run that test case) before commit. Should be good now with ddd6292. |
Allow `copy` statement/block parameter, closes hsutter#393 Allow `class` and `struct` and other reclaimed words as declared names, closes hsutter#394
Uh oh!
There was an error while loading. Please reload this page.
Bug description
struct
andclass
are not keywords in Cpp2, but I cannot declare a type namedstruct
orclass
.To Reproduce It
This is the sample code:
It should generate the following code:
But it leads to compilation faild:
Additional context
Also
typename
,typedef
,typeid
and other Cpp1-only keywords if used as type name will generate wrong source code.I think it's related to this issue that is fixed by applying prefix
cpp2_
to identifiers which are keywords in Cpp1.The text was updated successfully, but these errors were encountered: