Rafael Espindola | 925213b | 2013-07-04 16:16:58 +0000 | [diff] [blame] | 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 |
Richard Smith | dbd4d4c | 2014-06-16 15:16:56 +0000 | [diff] [blame] | 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 |
Richard Smith | 60f0263 | 2011-10-13 21:32:47 +0000 | [diff] [blame] | 12 | |
| 13 | void f(int n) { |
| 14 | typeof(n)(); |
| 15 | decltype(n)(); |
| 16 | } |
| 17 | |
| 18 | // CXX98: undeclared identifier 'typeof' |
| 19 | // CXX98: undeclared identifier 'decltype' |
| 20 | |
| 21 | // GNUXX98-NOT: undeclared identifier 'typeof' |
| 22 | // GNUXX98: undeclared identifier 'decltype' |
| 23 | |
| 24 | // CXX11: undeclared identifier 'typeof' |
| 25 | // CXX11-NOT: undeclared identifier 'decltype' |
| 26 | |
| 27 | // GNUXX11-NOT: undeclared identifier 'typeof' |
| 28 | // GNUXX11-NOT: undeclared identifier 'decltype' |
Richard Smith | 460fe6b | 2012-10-17 23:07:52 +0000 | [diff] [blame] | 29 | |
| 30 | // CXX1Y: undeclared identifier 'typeof' |
| 31 | // CXX1Y-NOT: undeclared identifier 'decltype' |
| 32 | |
| 33 | // GNUXX1Y-NOT: undeclared identifier 'typeof' |
| 34 | // GNUXX1Y-NOT: undeclared identifier 'decltype' |
Richard Smith | dbd4d4c | 2014-06-16 15:16:56 +0000 | [diff] [blame] | 35 | |
| 36 | // CXX1Z: undeclared identifier 'typeof' |
| 37 | // CXX1Z-NOT: undeclared identifier 'decltype' |
| 38 | |
| 39 | // GNUXX1Z-NOT: undeclared identifier 'typeof' |
| 40 | // GNUXX1Z-NOT: undeclared identifier 'decltype' |