blob: 1c4cbb2134e4917478ea0a0f377d3d5beb132f12 [file] [log] [blame]
Richard Smithe1677d92011-10-11 17:38:48 +00001// RUN: %clang_cc1 -fsyntax-only -std=c++98 -Wc++0x-compat -verify %s
2
3namespace 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
10template<typename T> void f(T) {} // expected-note {{here}}
11namespace M {
12 template void f<int>(int); // expected-warning {{explicit instantiation of 'f' must occur in the global namespace}}
13}
14
15void f() {
16 auto int n = 0; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++0x}}
17}
18
19int n;
20struct S {
21 char c;
22}
23s = { n }, // expected-warning {{non-constant-expression cannot be narrowed from type 'int' to 'char' in initializer list in C++0x}} expected-note {{explicit cast}}
24t = { 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}}