30 lines · cpp
1// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch %s -o %t2// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s3 4// RUN: %clang_cc1 -pedantic-errors -std=c++11 -emit-pch -fpch-instantiate-templates %s -o %t5// RUN: %clang_cc1 -pedantic-errors -std=c++11 -include-pch %t -verify %s6 7#ifndef HEADER_INCLUDED8 9#define HEADER_INCLUDED10 11template<typename T> struct S {12 enum class E {13 e = T()14 };15};16 17S<int> a;18S<long>::E b;19S<double>::E c;20template struct S<char>;21 22#else23 24int k1 = (int)S<int>::E::e;25int k2 = (int)decltype(b)::e;26int k3 = (int)decltype(c)::e; // expected-error@13 {{conversion from 'double' to 'int'}} expected-note {{here}}27int k4 = (int)S<char>::E::e;28 29#endif30