[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-10-03 Thread Aaron Ballman via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGaf16a4e131c1: Improve error message for constexpr constructors of virtual base classes (authored by NoumanAmir657, committed by aaron.ballman).

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-10-03 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. In D158540#4652792 , @aaron.ballman wrote: > The only thing left are the comments on the release note, but I can fix that > up when landing if you need me to commit on your behalf. If so, what name and > email address

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-10-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. The only thing left are the comments on the release note, but I can fix that up when landing if you need me to commit on your behalf. If so, what name and email address would you like me to use for patch attribution? Otherwise, if you have commit privileges, then

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-10-03 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 557571. NoumanAmir657 set the repository for this revision to rG LLVM Github Monorepo. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files:

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-10-03 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/docs/ReleaseNotes.rst:211-212 with terminals with dark background colors. This is also more consistent with GCC. +- Clang now displays an improved diagnostic and a note when defaulted special + member is a contexpr in

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-10-03 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 557557. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-10-03 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 557555. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-10-02 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/docs/ReleaseNotes.rst:211-212 with terminals with dark background colors. This is also more consistent with GCC. +- Clang now displays an improved diagnostic and a note when defaulted special + member is a contexpr in

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. In D158540#4652051 , @aaron.ballman wrote: > In D158540#4651859 , @NoumanAmir657 > wrote: > >> @aaron.Ballman >> Do I need to make changes other than this? The virtual base

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 557507. NoumanAmir657 set the repository for this revision to rG LLVM Github Monorepo. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files:

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 557504. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-29 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D158540#4651859 , @NoumanAmir657 wrote: > @aaron.Ballman > Do I need to make changes other than this? The virtual base diagnostic > doesn't have a test case in files that would generate it. Should I add the > above

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-29 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 557487. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp Index: clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-29 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 557480. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp Index: clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-29 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 557477. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp Index: clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-28 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. @aaron.Ballman Do I need to make changes other than this? The virtual base diagnostic doesn't have a test case in files that would generate it. Should I add the above example as the test case? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-28 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D158540#4643563 , @NoumanAmir657 wrote: > **Code:** > > struct Base { >constexpr Base() = default; > }; > struct Derived : virtual Base { > constexpr Derived() = default; > }; > > struct NoCopyMove

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-19 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. @aaron.ballman why the member is not an constexpr can be seen from getNumVBases(). The 'defaultedSpecialMemberIsConstexpr' returns false whenever getVNumBases is true for this so we can use that to identify when to give which error diagnostic. Can you verify

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-11 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. **Code:** struct Base { constexpr Base() = default; }; struct Derived : virtual Base { constexpr Derived() = default; }; struct NoCopyMove { constexpr NoCopyMove() {} NoCopyMove(const NoCopyMove&); NoCopyMove(NoCopyMove&&); };

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-11 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D158540#4638605 , @NoumanAmir657 wrote: > In D158540#4632457 , @NoumanAmir657 > wrote: > >> @aaron.ballman >> This error gets generated on test cases even when a struct/class

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-09-05 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. In D158540#4632457 , @NoumanAmir657 wrote: > @aaron.ballman > This error gets generated on test cases even when a struct/class as no > virtual base class. > see this example on here: example

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-31 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. @aaron.ballman This error gets generated on test cases even when a struct/class as no virtual base class. see this example on here: example Is this right behaviour? The note for this should not be generated since this does not

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-31 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. In D158540#4632240 , @aaron.ballman wrote: > In D158540#4629042 , @NoumanAmir657 > wrote: > >> Do you want the note to be like this: >> >> ../llvm-test/x.cpp:5:1: note: virtual

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D158540#4629042 , @NoumanAmir657 wrote: > Do you want the note to be like this: > > ../llvm-test/x.cpp:5:1: note: virtual base class declared here > 5 | struct Derived : virtual Base { > | ^ > 1 error

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. In D158540#4628958 , @aaron.ballman wrote: > In D158540#4628904 , @NoumanAmir657 > wrote: > >> In D158540#4628860 , >> @aaron.ballman

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. In D158540#4628958 , @aaron.ballman wrote: > In D158540#4628904 , @NoumanAmir657 > wrote: > >> In D158540#4628860 , >> @aaron.ballman

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D158540#4628904 , @NoumanAmir657 wrote: > In D158540#4628860 , @aaron.ballman > wrote: > >> In D158540#4628629 , >> @NoumanAmir657

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9396 def err_incorrect_defaulted_constexpr : Error< - "defaulted definition of %sub{select_special_member_kind}0 " - "is not constexpr">; + "%sub{select_special_member_kind}0

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. In D158540#4628860 , @aaron.ballman wrote: > In D158540#4628629 , @NoumanAmir657 > wrote: > >> In D158540#4628310 , >> @aaron.ballman

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D158540#4628629 , @NoumanAmir657 wrote: > In D158540#4628310 , @aaron.ballman > wrote: > >> In D158540#4628265 , >> @NoumanAmir657

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. In D158540#4628310 , @aaron.ballman wrote: > In D158540#4628265 , @NoumanAmir657 > wrote: > >> No, I don't have code examples that showcase the importance of the note. As >> you

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D158540#4628265 , @NoumanAmir657 wrote: > No, I don't have code examples that showcase the importance of the note. As > you said the class context would be obvious whenever we run into this error. > The test files also

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. No, I don't have code examples that showcase the importance of the note. As you said the class context would be obvious whenever we run into this error. The test files also don't show where the note would be helpful. CHANGES SINCE LAST ACTION

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman requested changes to this revision. aaron.ballman added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/Sema/SemaDeclCXX.cpp:7808-7809 +if (!MD->isConsteval()) { + Diag(MD->getBeginLoc(),

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. @xgupta the build is successful now. Earlier it failed due to format issues. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 ___ cfe-commits mailing list

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 554629. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-30 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 554626. NoumanAmir657 set the repository for this revision to rG LLVM Github Monorepo. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files:

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-29 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta accepted this revision. xgupta added a comment. This revision is now accepted and ready to land. LGTM, Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 ___ cfe-commits mailing list

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-29 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 554571. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-29 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta added a subscriber: rsmith. xgupta added a comment. Just address @rsmith, I think after that we are fine to commit this review. > + "%sub{select_special_member_kind}0 cannot be 'constexpr' in a class or > struct with virtual base classes">; Please don't say "class or struct" here.

Re: [PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-29 Thread Richard Smith via cfe-commits
On Tue, 22 Aug 2023 at 12:43, Nouman Amir via Phabricator via cfe-commits < cfe-commits@lists.llvm.org> wrote: > Index: clang/include/clang/Basic/DiagnosticSemaKinds.td > === > --- clang/include/clang/Basic/DiagnosticSemaKinds.td >

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-29 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 554489. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-29 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 554485. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/SemaDeclCXX.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-29 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta added a comment. In D158540#4620286 , @NoumanAmir657 wrote: > @xgupta It passed the test cases now Thanks, I think we also want a note similar to MSVC diagnostic: (6): note: see reference to function 'Derived::Derived(void)' CHANGES SINCE

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-27 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. @xgupta It passed the test cases now CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-27 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 updated this revision to Diff 553810. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/p3.cpp

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-27 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. I figured it out and changed the test files. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540 ___ cfe-commits mailing list

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-27 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 added a comment. How am I supposed to update tests? I am new to this. I get the files on which the tests fail but how do I update them Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158540/new/ https://reviews.llvm.org/D158540

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-27 Thread Shivam Gupta via Phabricator via cfe-commits
xgupta added reviewers: shafik, aaron.ballman. xgupta added a comment. Test case updates are missing due to which 7 test cases are failing on pre-merge check - https://buildkite.com/llvm-project/premerge-checks/builds/172995#018a2776-1461-4f98-b12d-bd0521352d50/6-14972. Repository: rG LLVM

[PATCH] D158540: Improve error message for constexpr constructors of virtual base classes

2023-08-22 Thread Nouman Amir via Phabricator via cfe-commits
NoumanAmir657 created this revision. NoumanAmir657 added a reviewer: CornedBee. Herald added a project: All. NoumanAmir657 requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The changes are for better diagnostic/error-messages. The error