summaryrefslogtreecommitdiffstats
path: root/test/PCH/cxx11-inheriting-ctors.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/PCH/cxx11-inheriting-ctors.cpp')
-rw-r--r--test/PCH/cxx11-inheriting-ctors.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/PCH/cxx11-inheriting-ctors.cpp b/test/PCH/cxx11-inheriting-ctors.cpp
new file mode 100644
index 0000000..79f78ba
--- /dev/null
+++ b/test/PCH/cxx11-inheriting-ctors.cpp
@@ -0,0 +1,39 @@
+// RUN: %clang_cc1 -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s
+
+// expected-no-diagnostics
+
+#ifndef HEADER_INCLUDED
+#define HEADER_INCLUDED
+
+struct Base {
+ Base(int) {}
+
+ template <typename T>
+ Base(T) {}
+};
+
+struct Test : Base {
+ using Base::Base;
+};
+
+template <typename T>
+struct Test2 : Base {
+ using Base::Base;
+};
+
+template <typename B>
+struct Test3 : B {
+ using B::B;
+};
+
+#else
+
+Test test1a(42);
+Test test1b(nullptr);
+Test2<int> test2a(42);
+Test2<int> test2b(nullptr);
+Test3<Base> test3a(42);
+Test3<Base> test3b(nullptr);
+
+#endif // HEADER_INCLUDED
OpenPOWER on IntegriCloud