-
Notifications
You must be signed in to change notification settings - Fork 7
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
CWG2852 [class.mem.general] Is a default argument of a class-scope lambda a complete-class context? #449
Comments
The aforementioned bugzilla thread
due to [class.mem.general]/7.1 (function body) + note4 for closure sub-class. The suggested resolution should be to |
@jensmaurer Well, all I need is to use |
EWG is the right group to discuss extensions to the language, not this forum. Side note: CWG2784 discusses an issue with interpreting the term "member-designator" from C's specification of "offsetof" in a C++ context. |
@stsp Instead of adding another complete-class context, you can make the class type dependent and defer performing instantiation until the class is complete: https://godbolt.org/z/sjbKGnqva (This is off-topic for this forum, but hopefully this example can save you and EWG some time.) |
That works, thank you!
But its a working solution. |
Full name of submitter (unless configured in github; will be published with the issue): Richard Smith
Reference (section label): [class.mem.general]/7
Link to reflector thread (if any): None, but GCC bugzilla thread: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111923
Issue description:
[class.mem.general]/7 is overly broad:
The "within" here appears to cover such things appearing indirectly within the member-specification, such as a default argument or default template argument of a class-scope lambda-expression:
Similarly, the current rule appears to treat noexcept-specifiers and default arguments appearing as part of all function types in the class body as complete-class context, rather than only those introduced in the declaration of a member or friend function:
Suggested resolution:
Change in [class.mem.general]/7:
The text was updated successfully, but these errors were encountered: