This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add test for CWG1397
ClosedPublic

Authored by Endill on May 20 2023, 11:13 AM.

Details

Reviewers
shafik
Group Reviewers
Restricted Project
Commits
rG9c561e8f3c2e: [clang] Add test for CWG1397
Summary

Resolution of this CWG breaks potential dependency loop between complete-class context of non-static data member initializer (NSDMI), and defaulted default constructor, which is noexcept depending on NSDMIs among other things.

For whatever reason in C++11 mode we issue an additional note and a different line number for the primary error. But I find the message itself even worse than aforementioned issues. It describes what's going on, but doesn't say what's bad about it. I find the previous version of this message more clear: https://github.com/llvm/llvm-project/commit/8dbc6b26171167b8ddf66a5f4b6d6fb9baf28336

Diff Detail

Event Timeline

Endill created this revision.May 20 2023, 11:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2023, 11:13 AM
Endill requested review of this revision.May 20 2023, 11:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 20 2023, 11:13 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
shafik accepted this revision.May 22 2023, 11:19 AM

LGTM

This revision is now accepted and ready to land.May 22 2023, 11:19 AM
shafik added inline comments.May 22 2023, 11:21 AM
clang/test/CXX/drs/dr13xx.cpp
488

These diagnostic are pretty bad, maybe provide a comment above explaining them a little better or maybe better refactor the diagnostic?

Thank you for the review!

clang/test/CXX/drs/dr13xx.cpp
488

Totally agree about diagnostic not being accessible. I filed a bug for that, but not sure how to refactor it.

I don't think it's a good place to explain complicated diagnostic messages, though. If someone is interested enough, intent could be seen on this review and in CWG1397 itself. We better just fix the diagnostic, and expected message together with it.

This revision was automatically updated to reflect the committed changes.