Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline

NoumanAmir657 (Nouman Amir)
User

Projects

User does not belong to any projects.

User Details

User Since
Aug 22 2023, 6:17 AM (14 w, 6 h)

Recent Activity

Oct 3 2023

NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

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 you can fix up the release note before landing the changes.

Oct 3 2023, 12:01 PM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Oct 3 2023, 11:11 AM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Oct 3 2023, 5:16 AM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Oct 3 2023, 5:02 AM · Restricted Project, Restricted Project

Sep 30 2023

NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

@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?

You'll need to add a test case to demonstrate the changes, and the example you had above would work well for the tests. You should also add a release note to clang/docs/ReleaseNotes.rst so users know about the improvement. But I think that should basically be all that's left to do here.

Sep 30 2023, 4:50 AM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Sep 30 2023, 4:46 AM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Sep 30 2023, 12:54 AM · Restricted Project, Restricted Project

Sep 29 2023

NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Sep 29 2023, 8:35 AM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Sep 29 2023, 6:09 AM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Sep 29 2023, 4:37 AM · Restricted Project, Restricted Project

Sep 28 2023

NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

@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?

Sep 28 2023, 1:55 PM · Restricted Project, Restricted Project

Sep 26 2023

NoumanAmir657 added a reviewer for D158540: Improve error message for constexpr constructors of virtual base classes: cor3ntin.
Sep 26 2023, 5:54 AM · Restricted Project, Restricted Project

Sep 19 2023

NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

@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 whether this would work or is there any problem with this. I haven't uploaded the diff yet

Sep 19 2023, 11:48 AM · Restricted Project, Restricted Project

Sep 11 2023

NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

Code:

struct Base {
 constexpr Base() = default;
};
struct Derived : virtual Base {
  constexpr Derived() = default;
};
Sep 11 2023, 1:24 PM · Restricted Project, Restricted Project

Sep 5 2023

NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

@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 have a virtual base class.

The example above is from a test case file in clang. The error message is the one which was supposed to be improved for this patch.

Can you clarify this

Sep 5 2023, 10:45 AM · Restricted Project, Restricted Project

Aug 31 2023

NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

@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

Aug 31 2023, 1:42 PM · Restricted Project, Restricted Project
NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

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 generated.

Close! I was thinking more like:

../llvm-test/x.cpp:5:1: note: virtual base class declared here
    5 | struct Derived : virtual Base {
      |                          ^
1 error generated.

(so the location points to the base class and not the derived class).

Aug 31 2023, 12:08 PM · Restricted Project, Restricted Project

Aug 30 2023

NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

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.

The crux of https://github.com/llvm/llvm-project/issues/64843 is about the error diagnostic, and that logic hasn't been changed in this patch -- are there other changes that are missing from the patch? The text of the tests shows that the error diagnostic behavior should have changed as well, but I'm not seeing the functional changes to make that happen.

Can you elaborate further? I did not understand what you mean by functional changes. According to my knowledge, I don't think anything else is missing from the patch.

The only changes I see in the review are the addition of note_incorrect_defaulted_constexpr and emitting that note. However, I see test cases changing from:

constexpr W() __constant = default; // expected-error {{defaulted definition of default constructor is not constexpr}}

to

constexpr W() __constant = default; // expected-error {{default constructor cannot be 'constexpr' in a class with virtual base classes}} expected-note {{see reference to function 'W' in 'W' class}}

where the error wording is now different, but I don't see any code changes to the compiler for the error wording.

I changed the error wording in the file DiagnosticSemaKinds.td

"%sub{select_special_member_kind}0 cannot be 'constexpr' in a class with virtual base classes">;

Okay, *now* I am seeing some changes there .. that's really strange, because my previous viewing only showed the *note* changing. I'm very sorry for the confusing noise; it could be that Phab is a bit flaky (it's considerably slower than it usually is).

Aug 30 2023, 11:08 AM · Restricted Project, Restricted Project
NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

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.

The crux of https://github.com/llvm/llvm-project/issues/64843 is about the error diagnostic, and that logic hasn't been changed in this patch -- are there other changes that are missing from the patch? The text of the tests shows that the error diagnostic behavior should have changed as well, but I'm not seeing the functional changes to make that happen.

Can you elaborate further? I did not understand what you mean by functional changes. According to my knowledge, I don't think anything else is missing from the patch.

The only changes I see in the review are the addition of note_incorrect_defaulted_constexpr and emitting that note. However, I see test cases changing from:

constexpr W() __constant = default; // expected-error {{defaulted definition of default constructor is not constexpr}}

to

constexpr W() __constant = default; // expected-error {{default constructor cannot be 'constexpr' in a class with virtual base classes}} expected-note {{see reference to function 'W' in 'W' class}}

where the error wording is now different, but I don't see any code changes to the compiler for the error wording.

I changed the error wording in the file DiagnosticSemaKinds.td

"%sub{select_special_member_kind}0 cannot be 'constexpr' in a class with virtual base classes">;

Okay, *now* I am seeing some changes there .. that's really strange, because my previous viewing only showed the *note* changing. I'm very sorry for the confusing noise; it could be that Phab is a bit flaky (it's considerably slower than it usually is).

Aug 30 2023, 10:46 AM · Restricted Project, Restricted Project
NoumanAmir657 added inline comments to D158540: Improve error message for constexpr constructors of virtual base classes.
Aug 30 2023, 10:33 AM · Restricted Project, Restricted Project
NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

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.

The crux of https://github.com/llvm/llvm-project/issues/64843 is about the error diagnostic, and that logic hasn't been changed in this patch -- are there other changes that are missing from the patch? The text of the tests shows that the error diagnostic behavior should have changed as well, but I'm not seeing the functional changes to make that happen.

Can you elaborate further? I did not understand what you mean by functional changes. According to my knowledge, I don't think anything else is missing from the patch.

The only changes I see in the review are the addition of note_incorrect_defaulted_constexpr and emitting that note. However, I see test cases changing from:

constexpr W() __constant = default; // expected-error {{defaulted definition of default constructor is not constexpr}}

to

constexpr W() __constant = default; // expected-error {{default constructor cannot be 'constexpr' in a class with virtual base classes}} expected-note {{see reference to function 'W' in 'W' class}}

where the error wording is now different, but I don't see any code changes to the compiler for the error wording.

Aug 30 2023, 10:14 AM · Restricted Project, Restricted Project
NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

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.

The crux of https://github.com/llvm/llvm-project/issues/64843 is about the error diagnostic, and that logic hasn't been changed in this patch -- are there other changes that are missing from the patch? The text of the tests shows that the error diagnostic behavior should have changed as well, but I'm not seeing the functional changes to make that happen.

Aug 30 2023, 8:31 AM · Restricted Project, Restricted Project
NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

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.

Aug 30 2023, 6:53 AM · Restricted Project, Restricted Project
NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

@xgupta the build is successful now. Earlier it failed due to format issues.

Aug 30 2023, 5:18 AM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Aug 30 2023, 1:45 AM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Aug 30 2023, 1:34 AM · Restricted Project, Restricted Project

Aug 29 2023

NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Aug 29 2023, 10:21 PM · Restricted Project, Restricted Project
NoumanAmir657 set the repository for D158540: Improve error message for constexpr constructors of virtual base classes to rG LLVM Github Monorepo.
Aug 29 2023, 4:01 PM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Aug 29 2023, 2:05 PM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Aug 29 2023, 1:49 PM · Restricted Project, Restricted Project

Aug 27 2023

NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

@xgupta It passed the test cases now

Aug 27 2023, 2:16 PM · Restricted Project, Restricted Project
NoumanAmir657 updated the diff for D158540: Improve error message for constexpr constructors of virtual base classes.
Aug 27 2023, 1:38 PM · Restricted Project, Restricted Project
NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

I figured it out and changed the test files.

Aug 27 2023, 12:59 PM · Restricted Project, Restricted Project
NoumanAmir657 added a comment to D158540: Improve error message for constexpr constructors of virtual base classes.

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

Aug 27 2023, 11:18 AM · Restricted Project, Restricted Project

Aug 24 2023

NoumanAmir657 added a comment to D158616: To allow RAV to visit initializer when bitfield and initializer both given.

The pre-commit checks passed now when I built again. Looking into test for this now

Aug 24 2023, 12:56 AM · Restricted Project, Restricted Project

Aug 23 2023

NoumanAmir657 requested review of D158616: To allow RAV to visit initializer when bitfield and initializer both given.
Aug 23 2023, 7:16 AM · Restricted Project, Restricted Project

Aug 22 2023

NoumanAmir657 requested review of D158540: Improve error message for constexpr constructors of virtual base classes.
Aug 22 2023, 12:43 PM · Restricted Project, Restricted Project