summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/modules-ts.cppm
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-04-22 22:50:11 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-04-22 22:50:11 +0000
commite181de7f4fe9c75327836e5493c2783bcefc9293 (patch)
tree014979d3a317a1d57bcb86609e0d1f11c98ebd55 /clang/test/SemaCXX/modules-ts.cppm
parent68602ab2f3535291753a6149d1f445c5fd416152 (diff)
downloadbcm5719-llvm-e181de7f4fe9c75327836e5493c2783bcefc9293.tar.gz
bcm5719-llvm-e181de7f4fe9c75327836e5493c2783bcefc9293.zip
[c++2a] Implement semantic restrictions for 'export' declarations.
llvm-svn: 358932
Diffstat (limited to 'clang/test/SemaCXX/modules-ts.cppm')
-rw-r--r--clang/test/SemaCXX/modules-ts.cppm10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/test/SemaCXX/modules-ts.cppm b/clang/test/SemaCXX/modules-ts.cppm
index c07ee82e313..1081995c586 100644
--- a/clang/test/SemaCXX/modules-ts.cppm
+++ b/clang/test/SemaCXX/modules-ts.cppm
@@ -49,8 +49,12 @@ int use_a = a; // expected-error {{declaration of 'a' must be imported from modu
import foo;
export {} // expected-error {{export declaration cannot be empty}}
-export { ; }
-export { static_assert(true); }
+export { // expected-note {{begins here}}
+ ; // expected-warning {{ISO C++20 does not permit an empty declaration to appear in an export block}}
+}
+export { // expected-note {{begins here}}
+ static_assert(true); // expected-warning {{ISO C++20 does not permit a static_assert declaration to appear in an export block}}
+}
int use_b = b;
int use_n = n; // FIXME: this should not be visible, because it is not exported
@@ -74,7 +78,7 @@ struct S {
// language rules right now, but (per personal correspondence between zygoloid
// and gdr) is the intent.
#if TEST == 1
-export {
+export { // expected-note {{export block begins here}}
extern "C++" {
namespace NestedExport {
export { // expected-error {{appears within another export}}
OpenPOWER on IntegriCloud