-
Notifications
You must be signed in to change notification settings - Fork 249
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
[BUG] Parameter named after contextual keyword is lost #397
Comments
See also #387 (comment). I believe VisualizedThat may be relevant in deciding the semantic meaning of |
Thanks, this is a good example. The linked PR #505 would allow this code:
I'm inclined to say that these should be interpreted as a missing parameter name, and should get a better diagnostic and be rejected at compile time. I don't think I want to allow these. Are they ever necessary? They seem confusing (at least visually) and allowing them creates new things to teach and learn that would not be necessary if we disallowed parameters named the same as a parameter qualifier (parameter-direction or this-specifier). |
That makes sense. |
It's okay, I just made the change and am about to check it in. Thanks again! |
Title: Parameter named after contextual keyword is lost.
Such a Cpp2 parameter is lowered to Cpp1 as no parameter at all.
Minimal reproducer (https://cpp2.godbolt.org/z/1exj84Wb4):
Commands:
cppfront -clean-cpp1 main.cpp2 clang++17 -std=c++2b -stdlib=libc++ -lc++abi -I . main.cpp
Expected result:
A diagnostic,
or the equivalent using
y
as an identifier.Actual result and error:
The text was updated successfully, but these errors were encountered: