blob: ace12e0922d44c53a1085bfdaff174b9bad6a310 [file] [log] [blame]
Argyrios Kyrtzidis0d396892010-07-22 17:28:12 +00001// Test this without pch.
Richard Smith762bb9d2011-10-13 22:29:44 +00002// RUN: %clang_cc1 -include %s -verify -std=c++11 %s
Argyrios Kyrtzidis0d396892010-07-22 17:28:12 +00003
4// Test with pch.
Richard Smith762bb9d2011-10-13 22:29:44 +00005// RUN: %clang_cc1 -std=c++11 -emit-pch -o %t %s
6// RUN: %clang_cc1 -include-pch %t -verify -std=c++11 %s
Argyrios Kyrtzidis0d396892010-07-22 17:28:12 +00007
Argyrios Kyrtzidis36615b82011-05-04 14:58:28 +00008#ifndef HEADER
9#define HEADER
10
11template<int N> struct T {
12 static_assert(N == 2, "N is not 2!"); // expected-error {{static_assert failed "N is not 2!"}}
13};
14
15#else
Argyrios Kyrtzidis0d396892010-07-22 17:28:12 +000016
17T<1> t1; // expected-note {{in instantiation of template class 'T<1>' requested here}}
18T<2> t2;
Argyrios Kyrtzidis36615b82011-05-04 14:58:28 +000019
20#endif