xref: /minix3/external/bsd/llvm/dist/clang/test/PCH/cxx11-inheriting-ctors.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -emit-pch -o %t %s
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -std=c++11 -include-pch %t -verify %s
3*0a6a1f1dSLionel Sambuc 
4*0a6a1f1dSLionel Sambuc // expected-no-diagnostics
5*0a6a1f1dSLionel Sambuc 
6*0a6a1f1dSLionel Sambuc #ifndef HEADER_INCLUDED
7*0a6a1f1dSLionel Sambuc #define HEADER_INCLUDED
8*0a6a1f1dSLionel Sambuc 
9*0a6a1f1dSLionel Sambuc struct Base {
BaseBase10*0a6a1f1dSLionel Sambuc   Base(int) {}
11*0a6a1f1dSLionel Sambuc 
12*0a6a1f1dSLionel Sambuc   template <typename T>
BaseBase13*0a6a1f1dSLionel Sambuc   Base(T) {}
14*0a6a1f1dSLionel Sambuc };
15*0a6a1f1dSLionel Sambuc 
16*0a6a1f1dSLionel Sambuc struct Test : Base {
17*0a6a1f1dSLionel Sambuc   using Base::Base;
18*0a6a1f1dSLionel Sambuc };
19*0a6a1f1dSLionel Sambuc 
20*0a6a1f1dSLionel Sambuc template <typename T>
21*0a6a1f1dSLionel Sambuc struct Test2 : Base {
22*0a6a1f1dSLionel Sambuc   using Base::Base;
23*0a6a1f1dSLionel Sambuc };
24*0a6a1f1dSLionel Sambuc 
25*0a6a1f1dSLionel Sambuc template <typename B>
26*0a6a1f1dSLionel Sambuc struct Test3 : B {
27*0a6a1f1dSLionel Sambuc   using B::B;
28*0a6a1f1dSLionel Sambuc };
29*0a6a1f1dSLionel Sambuc 
30*0a6a1f1dSLionel Sambuc #else
31*0a6a1f1dSLionel Sambuc 
32*0a6a1f1dSLionel Sambuc Test test1a(42);
33*0a6a1f1dSLionel Sambuc Test test1b(nullptr);
34*0a6a1f1dSLionel Sambuc Test2<int> test2a(42);
35*0a6a1f1dSLionel Sambuc Test2<int> test2b(nullptr);
36*0a6a1f1dSLionel Sambuc Test3<Base> test3a(42);
37*0a6a1f1dSLionel Sambuc Test3<Base> test3b(nullptr);
38*0a6a1f1dSLionel Sambuc 
39*0a6a1f1dSLionel Sambuc #endif // HEADER_INCLUDED
40