Richard Smith | e1677d9 | 2011-10-11 17:38:48 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wc++0x-compat -verify %s |
| 2 | |
| 3 | namespace N { |
| 4 | template<typename T> void f(T) {} // expected-note {{here}} |
| 5 | namespace M { |
| 6 | template void f<int>(int); // expected-warning {{explicit instantiation of 'N::f' must occur in namespace 'N'}} |
| 7 | } |
| 8 | } |
| 9 | |
| 10 | template<typename T> void f(T) {} // expected-note {{here}} |
| 11 | namespace M { |
| 12 | template void f<int>(int); // expected-warning {{explicit instantiation of 'f' must occur in the global namespace}} |
| 13 | } |
| 14 | |
| 15 | void f() { |
| 16 | auto int n = 0; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++0x}} |
| 17 | } |
| 18 | |
| 19 | int n; |
| 20 | struct S { |
| 21 | char c; |
| 22 | } |
| 23 | s = { n }, // expected-warning {{non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list in C++0x}} expected-note {{explicit cast}} |
| 24 | t = { 1234 }; // expected-warning {{constant expression evaluates to 1234 which cannot be narrowed to type 'char' in C++0x}} expected-warning {{changes value}} expected-note {{explicit cast}} |