blob: 464da405c3e2ec9bbecd41cf33314b401719dea1 [file] [log] [blame]
Argyrios Kyrtzidis0d396892010-07-22 17:28:12 +00001// Test this without pch.
Argyrios Kyrtzidis36615b82011-05-04 14:58:28 +00002// RUN: %clang_cc1 -include %s -verify -std=c++0x %s
Argyrios Kyrtzidis0d396892010-07-22 17:28:12 +00003
4// Test with pch.
Argyrios Kyrtzidis36615b82011-05-04 14:58:28 +00005// RUN: %clang_cc1 -std=c++0x -emit-pch -o %t %s
Argyrios Kyrtzidis0d396892010-07-22 17:28:12 +00006// RUN: %clang_cc1 -include-pch %t -verify -std=c++0x %s
7
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