1 // RUN: not %clang -std=c++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
2 // RUN: not %clang -std=gnu++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX98 %s
3 // RUN: not %clang -std=c++03 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
4 // RUN: not %clang -std=c++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
5 // RUN: not %clang -std=gnu++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
6 // RUN: not %clang -std=c++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
7 // RUN: not %clang -std=gnu++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
8 // RUN: not %clang -std=c++1y %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX1Y %s
9 // RUN: not %clang -std=gnu++1y %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX1Y %s
10 // RUN: not %clang -std=c++1z %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX1Z %s
11 // RUN: not %clang -std=gnu++1z %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX1Z %s
12 // RUN: not %clang -std=c++2a %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX2A %s
13 // RUN: not %clang -std=gnu++2a %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX2A %s
14 // RUN: not %clang -std=c++2b %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX2B %s
15 // RUN: not %clang -std=gnu++2b %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX2B %s
16 
f(int n)17 void f(int n) {
18   typeof(n)();
19   decltype(n)();
20 }
21 
22 // CXX98: undeclared identifier 'typeof'
23 // CXX98: undeclared identifier 'decltype'
24 
25 // GNUXX98-NOT: undeclared identifier 'typeof'
26 // GNUXX98: undeclared identifier 'decltype'
27 
28 // CXX11: undeclared identifier 'typeof'
29 // CXX11-NOT: undeclared identifier 'decltype'
30 
31 // GNUXX11-NOT: undeclared identifier 'typeof'
32 // GNUXX11-NOT: undeclared identifier 'decltype'
33 
34 // CXX1Y: undeclared identifier 'typeof'
35 // CXX1Y-NOT: undeclared identifier 'decltype'
36 
37 // GNUXX1Y-NOT: undeclared identifier 'typeof'
38 // GNUXX1Y-NOT: undeclared identifier 'decltype'
39 
40 // CXX1Z: undeclared identifier 'typeof'
41 // CXX1Z-NOT: undeclared identifier 'decltype'
42 
43 // GNUXX1Z-NOT: undeclared identifier 'typeof'
44 // GNUXX1Z-NOT: undeclared identifier 'decltype'
45 
46 // CXX2A: undeclared identifier 'typeof'
47 // CXX2A-NOT: undeclared identifier 'decltype'
48 
49 // GNUXX2A-NOT: undeclared identifier 'typeof'
50 // GNUXX2A-NOT: undeclared identifier 'decltype'
51 
52 // CXX2B: undeclared identifier 'typeof'
53 // CXX2B-NOT: undeclared identifier 'decltype'
54 
55 // GNUXX2B-NOT: undeclared identifier 'typeof'
56 // GNUXX2B-NOT: undeclared identifier 'decltype'
57