summaryrefslogtreecommitdiff
path: root/clang/test/Modules/ModulesLocalNamespace.cppm
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Modules/ModulesLocalNamespace.cppm')
-rw-r--r--clang/test/Modules/ModulesLocalNamespace.cppm47
1 files changed, 47 insertions, 0 deletions
diff --git a/clang/test/Modules/ModulesLocalNamespace.cppm b/clang/test/Modules/ModulesLocalNamespace.cppm
new file mode 100644
index 000000000000..9e0559780975
--- /dev/null
+++ b/clang/test/Modules/ModulesLocalNamespace.cppm
@@ -0,0 +1,47 @@
+// RUN: rm -rf %t
+// RUN: mkdir -p %t
+// RUN: split-file %s %t
+//
+// RUN: %clang_cc1 -std=c++20 %t/a.cppm -emit-module-interface -o %t/a.pcm
+// RUN: %clang_cc1 -std=c++20 %t/m-a.cppm -emit-module-interface -o %t/m-a.pcm
+// RUN: %clang_cc1 -std=c++20 %t/b.cppm -emit-module-interface -o %t/m-b.pcm \
+// RUN: -fprebuilt-module-path=%t
+// RUN: %clang_cc1 -std=c++20 %t/b.cpp -fsyntax-only -verify -fprebuilt-module-path=%t
+
+//--- a.cppm
+export module a;
+namespace aa {
+
+}
+
+//--- m-a.cppm
+export module m:a;
+namespace aa {
+struct A {};
+}
+
+//--- b.cppm
+module m:b;
+import :a;
+
+namespace bb {
+struct B {
+ void func(aa::A);
+};
+}
+
+//--- b.cpp
+// expected-no-diagnostics
+module m:b.impl;
+import a;
+import :b;
+
+namespace bb {
+using namespace aa;
+
+void B::func(A) {}
+
+}
+
+
+