| 1 |
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t |
| 2 |
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s |
| 3 |
|
| 4 |
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch -fpch-instantiate-templates %s -o %t |
| 5 |
// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s |
| 6 |
|
| 7 |
#ifndef HEADER_INCLUDED |
| 8 |
|
| 9 |
#define HEADER_INCLUDED |
| 10 |
|
| 11 |
template<typename T> struct S { |
| 12 |
enum class E { |
| 13 |
e = T() |
| 14 |
}; |
| 15 |
}; |
| 16 |
|
| 17 |
S<int> a; |
| 18 |
S<long>::E b; |
| 19 |
S<double>::E c; |
| 20 |
template struct S<char>; |
| 21 |
|
| 22 |
#else |
| 23 |
|
| 24 |
int k1 = (int)S<int>::E::e; |
| 25 |
int k2 = (int)decltype(b)::e; |
| 26 |
int k3 = (int)decltype(c)::e; // expected-error@13 {{conversion from 'double' to 'int'}} expected-note {{here}} |
| 27 |
int k4 = (int)S<char>::E::e; |
| 28 |
|
| 29 |
#endif |