-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[Clang] Implement CWG2496 #142975
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
[Clang] Implement CWG2496 #142975
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,3 +215,23 @@ void (*q)() throw() = S(); | |
| // since-cxx17-error@-1 {{no viable conversion from 'S' to 'void (*)() throw()'}} | ||
| // since-cxx17-note@#cwg2486-conv {{candidate function}} | ||
| } // namespace cwg2486 | ||
|
|
||
|
|
||
| namespace cwg2496 { // cwg2496: 21 | ||
| #if __cplusplus >= 201102L | ||
| struct S { | ||
| virtual void f(); // expected-note {{previous declaration is here}} | ||
| virtual void g() &; // expected-note {{previous declaration is here}} | ||
| virtual void h(); // expected-note {{previous declaration is here}} | ||
| }; | ||
|
|
||
| struct T : S { | ||
| virtual void f() &; | ||
| // expected-error@-1 {{cannot overload a member function with ref-qualifier '&' with a member function without a ref-qualifier}} | ||
| virtual void g(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd also like to see a case where it's declared as
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i added the l case afterwards :) |
||
| // expected-error@-1 {{cannot overload a member function without a ref-qualifier with a member function with ref-qualifier '&'}} | ||
| virtual void h() &&; | ||
| // expected-error@-1 {{cannot overload a member function with ref-qualifier '&&' with a member function without a ref-qualifier}} | ||
| }; | ||
| #endif | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leave a bookmark here, and move the notes after their respective errors