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#ifndef HEADER_INCLUDED
5
6#define HEADER_INCLUDED
7
8template<typename T> struct S {
9  enum class E {
10    e = T()
11  };
12};
13
14S<int> a;
15S<long>::E b;
16S<double>::E c;
17template struct S<char>;
18
19#else
20
21int k1 = (int)S<int>::E::e;
22int k2 = (int)decltype(b)::e;
23int k3 = (int)decltype(c)::e; // expected-error@10 {{conversion from 'double' to 'int'}} expected-note {{here}}
24int k4 = (int)S<char>::E::e;
25
26#endif
27