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