blob: 822658c837dc120f77b9ce80bd1ebc1613676ffb [file] [log] [blame]
Richard Smith60f02632011-10-13 21:32:47 +00001// RUN: %clang -std=c++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
2// RUN: %clang -std=gnu++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX98 %s
Richard Smith172604a2011-10-14 00:34:28 +00003// RUN: %clang -std=c++03 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
Richard Smith60f02632011-10-13 21:32:47 +00004// RUN: %clang -std=c++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
5// RUN: %clang -std=gnu++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
6// RUN: %clang -std=c++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
7// RUN: %clang -std=gnu++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
Richard Smith460fe6b2012-10-17 23:07:52 +00008// RUN: %clang -std=c++1y %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX1Y %s
9// RUN: %clang -std=gnu++1y %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX1Y %s
Richard Smith60f02632011-10-13 21:32:47 +000010
11void f(int n) {
12 typeof(n)();
13 decltype(n)();
14}
15
16// CXX98: undeclared identifier 'typeof'
17// CXX98: undeclared identifier 'decltype'
18
19// GNUXX98-NOT: undeclared identifier 'typeof'
20// GNUXX98: undeclared identifier 'decltype'
21
22// CXX11: undeclared identifier 'typeof'
23// CXX11-NOT: undeclared identifier 'decltype'
24
25// GNUXX11-NOT: undeclared identifier 'typeof'
26// GNUXX11-NOT: undeclared identifier 'decltype'
Richard Smith460fe6b2012-10-17 23:07:52 +000027
28// CXX1Y: undeclared identifier 'typeof'
29// CXX1Y-NOT: undeclared identifier 'decltype'
30
31// GNUXX1Y-NOT: undeclared identifier 'typeof'
32// GNUXX1Y-NOT: undeclared identifier 'decltype'