You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Parameter named after contextual keyword is lost #397
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).
Activity
JohelEGP commentedon Apr 30, 2023
See also #387 (comment).
I believe
(in: T)should be a function type with an by-inparameter of typeT.Visualized
See https://highlight-cpp2.godbolt.org/z/K9nvoqKdh.

That may be relevant in deciding the semantic meaning of
(𝘵𝘩𝘪𝘴-𝘴𝘱𝘦𝘤𝘪𝘧𝘪𝘦𝘳)as a parameter-declaration-list.hsutter commentedon Aug 10, 2023
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).
JohelEGP commentedon Aug 10, 2023
That makes sense.
I wasn't sure before, but now I'm convinced.
I'll rebase #505 to diagnose as you mentioned.
hsutter commentedon Aug 10, 2023
It's okay, I just made the change and am about to check it in. Thanks again!
Diagnose missing parameter after a this-specifier or parameter-direct…
Diagnose missing parameter after a this-specifier or parameter-direct…