This is an archive of the discontinued LLVM Phabricator instance.

[clang][sema] Allow unnamed decls in C++20 module export{} blocks
AbandonedPublic

Authored by tbaeder on Jan 14 2022, 2:26 AM.

Details

Summary

As part of P1766R1, allow unnamed decls in export{} blocks.

I've adjusted the module-ts tests as well, but I am (generally) not sure whether code for C++20 modules should affect the modules-ts cases. What's the policy here?

Diff Detail

Event Timeline

tbaeder requested review of this revision.Jan 14 2022, 2:26 AM
tbaeder created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 14 2022, 2:26 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Reading this again, it sounds like this is not expected to happen for C++20; I was using https://clang.llvm.org/cxx_status.html#cxx20 as guidance here.

tbaeder updated this revision to Diff 402813.Jan 25 2022, 2:44 AM

Limited the change to c++2b

ChuanqiXu added inline comments.
clang/lib/Sema/SemaModule.cpp
650–652

Should we add a cite to P1766R1 here?

clang/test/CXX/module/module.interface/p3.cpp
12–16 ↗(On Diff #402813)

This one should be deleted unintentionally.

tbaeder marked an inline comment as done.Jan 25 2022, 3:35 AM
tbaeder added inline comments.
clang/lib/Sema/SemaModule.cpp
650–652

I wanted to do that, but I'm not 100% sure how. P1766R1 doesn't seem to change any wording for this change. What exactly do I cite?

clang/test/CXX/module/module.interface/p3.cpp
12–16 ↗(On Diff #402813)

Right, I forgot about that. Added it back, thanks.

ChuanqiXu added inline comments.Jan 25 2022, 3:46 AM
clang/lib/Sema/SemaModule.cpp
650–652

I am not sure about the standard method. But I guess it might not be bad to write something like:

// P1766R1 removed the rule that a declaration in an export block introduces at least one name. The rule for the single-declaration form of export is retained.
// FIXME: Cite for labels when it shows in the draft.

BTW, you could send a pull request or an issue at: https://github.com/cplusplus/draft to do the change. Since P1766R1 is adopted, so this change should be editorial.

tbaeder updated this revision to Diff 402874.Jan 25 2022, 5:43 AM
tbaeder marked an inline comment as done.
tbaeder marked 2 inline comments as done.
tbaeder added inline comments.
clang/lib/Sema/SemaModule.cpp
650–652

Thanks, I added a comment and opened https://github.com/cplusplus/draft/issues/5237

Oh, it looks like we couldn't go on since the part of PR1766R1 is not adopted: https://github.com/cplusplus/draft/issues/5237

tbaeder abandoned this revision.Feb 21 2022, 10:57 PM
tbaeder marked an inline comment as done.