[C++20][Modules] Implement P2615R1 revised export diagnostics.
authorIain Sandoe <iain@sandoe.co.uk>
Wed, 14 Jun 2023 18:48:04 +0000 (19:48 +0100)
committerIain Sandoe <iain@sandoe.co.uk>
Sat, 24 Jun 2023 08:01:59 +0000 (09:01 +0100)
commite5c7904fa0bfa5a24f192cfa7b9116560e1f5d43
tree5cb516fe5c8b9eabdfaa60324bf11be867173b9b
parent339a1f3ce36067facae6aa4b9f9901c791e481e7
[C++20][Modules] Implement P2615R1 revised export diagnostics.

It has been reported to that the current clang  errors for, specifically,
static_assert in export contexts are a serious blocker to adoption of
modules in some cases.

There is also implementation divergence with GCC and MSVC allowing the
constructs mentioned below where clang currently rejects them with an
error.

The category of errors [for declarations in an exported context] is:
(unnamed, static_assert, empty and asm decls). These are now permitted
after P2615R1 which was approved by WG21 as a DR (and thus should be
applied to C++20 as well).

This patch removes these diagnostics and amends the testsuite accordingly.

Differential Revision: https://reviews.llvm.org/D152946
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/lib/Sema/SemaModule.cpp
clang/test/CXX/module/module.interface/p3.cpp
clang/test/Modules/cxx20-10-2-ex1.cpp
clang/test/Modules/cxx20-10-2-ex7.cpp
clang/test/SemaCXX/modules.cppm