summaryrefslogtreecommitdiff
path: root/test/Modules/using-decl-inheritance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Modules/using-decl-inheritance.cpp')
-rw-r--r--test/Modules/using-decl-inheritance.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/Modules/using-decl-inheritance.cpp b/test/Modules/using-decl-inheritance.cpp
new file mode 100644
index 000000000000..eba9636b75ef
--- /dev/null
+++ b/test/Modules/using-decl-inheritance.cpp
@@ -0,0 +1,34 @@
+// RUN: %clang_cc1 -x c++ -fmodules -fmodules-local-submodule-visibility -fmodules-cache-path=%t %s -verify
+// RUN: %clang_cc1 -x c++ -fmodules -fmodules-cache-path=%t %s -verify
+
+// expected-no-diagnostics
+
+#pragma clang module build A
+ module A { }
+#pragma clang module contents
+#pragma clang module begin A
+struct A {
+ virtual void Foo(double x) const;
+};
+#pragma clang module end
+#pragma clang module endbuild
+
+#pragma clang module build B
+ module B { }
+#pragma clang module contents
+#pragma clang module begin B
+#pragma clang module import A
+struct B : A {
+ using A::Foo;
+ virtual void Foo(double x) const;
+};
+#pragma clang module end
+#pragma clang module endbuild
+
+#pragma clang module import B
+
+int main() {
+ B b;
+ b.Foo(1.0);
+}
+