summaryrefslogtreecommitdiff
path: root/test/SemaCXX/anonymous-union-export.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/anonymous-union-export.cpp')
-rw-r--r--test/SemaCXX/anonymous-union-export.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/SemaCXX/anonymous-union-export.cpp b/test/SemaCXX/anonymous-union-export.cpp
new file mode 100644
index 0000000000000..1d83d809f5207
--- /dev/null
+++ b/test/SemaCXX/anonymous-union-export.cpp
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -std=c++17 -fmodules-ts -emit-obj -verify -o %t.pcm %s
+
+export module M;
+export {
+ union { bool a; }; // expected-error{{anonymous unions at namespace or global scope must be declared 'static'}}
+}