69 lines · cpp
1// RUN: %clang_cc1 -std=c++11 -include %s -include %s -verify %s2//3// Emit with definitions in the declaration:4// RxN: %clang_cc1 -std=c++11 -emit-pch -o %t.12 -include %s %s5// RxN: %clang_cc1 -std=c++11 -include-pch %t.12 -verify %s6//7// RxN: %clang_cc1 -std=c++11 -emit-pch -fpch-instantiate-templates -o %t.12 -include %s %s8// RxN: %clang_cc1 -std=c++11 -include-pch %t.12 -verify %s9//10// Emit with definitions in update records:11// RxN: %clang_cc1 -std=c++11 -emit-pch -o %t.1 %s12// RxN: %clang_cc1 -std=c++11 -include-pch %t.1 -emit-pch -o %t.2 -verify %s13// RxN: %clang_cc1 -std=c++11 -include-pch %t.1 -include-pch %t.2 -verify %s14//15// RxN: %clang_cc1 -std=c++11 -emit-pch -fpch-instantiate-templates -o %t.1 %s16// RxN: %clang_cc1 -std=c++11 -include-pch %t.1 -emit-pch -fpch-instantiate-templates -o %t.2 -verify %s17// RxN: %clang_cc1 -std=c++11 -include-pch %t.1 -include-pch %t.2 -verify %s18 19 20// expected-no-diagnostics21 22#ifndef HEADER123#define HEADER124 25struct Base {26 Base(int) {}27 28 template <typename T>29 Base(T) {}30};31 32struct Test : Base {33 using Base::Base;34};35 36template <typename T>37struct Test2 : Base {38 using Base::Base;39};40 41template <typename B>42struct Test3 : B {43 using B::B;44};45 46#elif !defined(HEADER2)47#define HEADER248 49Test test1a(42);50Test test1b(nullptr);51Test2<int> test2a(42);52Test2<int> test2b(nullptr);53Test3<Base> test3a(42);54Test3<Base> test3b(nullptr);55 56#pragma clang __debug dump Test57#pragma clang __debug dump Test258 59#else60 61Test retest1a(42);62Test retest1b(nullptr);63Test2<int> retest2a(42);64Test2<int> retest2b(nullptr);65Test3<Base> retest3a(42);66Test3<Base> retest3b(nullptr);67 68#endif69