Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / PCH / cxx11-enum-template.cpp
blob52c47811a9842a993da68adc386b2004763168b4
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
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
7 #ifndef HEADER_INCLUDED
9 #define HEADER_INCLUDED
11 template<typename T> struct S {
12 enum class E {
13 e = T()
17 S<int> a;
18 S<long>::E b;
19 S<double>::E c;
20 template struct S<char>;
22 #else
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;
29 #endif