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