25 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s2 3template<typename T>4struct X {5 void f() {}6};7 8template inline void X<int>::f(); // expected-error{{explicit instantiation cannot be 'inline'}}9 10template<typename T>11struct Y {12 constexpr int f() { return 0; } // expected-warning{{C++14}}13};14 15template constexpr int Y<int>::f() const; // expected-error{{explicit instantiation cannot be 'constexpr'}}16 17template<typename T>18struct Z {19 enum E : T { e1, e2 };20 T t; // expected-note {{refers here}}21};22 23template enum Z<int>::E; // expected-error {{enumerations cannot be explicitly instantiated}}24template int Z<int>::t; // expected-error {{explicit instantiation of 't' does not refer to}}25