| 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wc++11-compat %s |
| 2 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 -Wc++11-compat %s |
| 3 | // RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s |
| 4 | |
| 5 | namespace N { |
| 6 | template<class T> class Y { // expected-note{{explicit instantiation refers here}} |
| 7 | void mf() { } |
| 8 | }; |
| 9 | } |
| 10 | |
| 11 | template class Z<int>; // expected-error{{explicit instantiation of non-template class 'Z'}} |
| 12 | |
| 13 | // FIXME: This example from the standard is wrong; note posted to CWG reflector |
| 14 | // on 10/27/2009 |
| 15 | using N::Y; |
| 16 | template class Y<int>; |
| 17 | #if __cplusplus <= 199711L |
| 18 | // expected-warning@-2 {{explicit instantiation of 'N::Y' must occur in namespace 'N'}} |
| 19 | #else |
| 20 | // expected-error@-4 {{explicit instantiation of 'N::Y' must occur in namespace 'N'}} |
| 21 | #endif |
| 22 | |
| 23 | template class N::Y<char*>; |
| 24 | template void N::Y<double>::mf(); |
| 25 | |