Home | History | Annotate | Download | only in PCH
      1 // RUN: %clang_cc1 -std=c++11 -include %s -include %s -verify %s
      2 //
      3 // Emit with definitions in the declaration:
      4 // RxN: %clang_cc1 -std=c++11 -emit-pch -o %t.12 -include %s %s
      5 // RxN: %clang_cc1 -std=c++11 -include-pch %t.12 -verify %s
      6 //
      7 // Emit with definitions in update records:
      8 // RxN: %clang_cc1 -std=c++11 -emit-pch -o %t.1 %s
      9 // RxN: %clang_cc1 -std=c++11 -include-pch %t.1 -emit-pch -o %t.2 -verify %s
     10 // RxN: %clang_cc1 -std=c++11 -include-pch %t.1 -include-pch %t.2 -verify %s
     11 
     12 
     13 // expected-no-diagnostics
     14 
     15 #ifndef HEADER1
     16 #define HEADER1
     17 
     18 struct Base {
     19   Base(int) {}
     20 
     21   template <typename T>
     22   Base(T) {}
     23 };
     24 
     25 struct Test : Base {
     26   using Base::Base;
     27 };
     28 
     29 template <typename T>
     30 struct Test2 : Base {
     31   using Base::Base;
     32 };
     33 
     34 template <typename B>
     35 struct Test3 : B {
     36   using B::B;
     37 };
     38 
     39 #elif !defined(HEADER2)
     40 #define HEADER2
     41 
     42 Test test1a(42);
     43 Test test1b(nullptr);
     44 Test2<int> test2a(42);
     45 Test2<int> test2b(nullptr);
     46 Test3<Base> test3a(42);
     47 Test3<Base> test3b(nullptr);
     48 
     49 #pragma clang __debug dump Test
     50 #pragma clang __debug dump Test2
     51 
     52 #else
     53 
     54 Test retest1a(42);
     55 Test retest1b(nullptr);
     56 Test2<int> retest2a(42);
     57 Test2<int> retest2b(nullptr);
     58 Test3<Base> retest3a(42);
     59 Test3<Base> retest3b(nullptr);
     60 
     61 #endif
     62