Richard Smith | 60f0263 | 2011-10-13 21:32:47 +0000 | [diff] [blame] | 1 | // 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 Smith | 172604a | 2011-10-14 00:34:28 +0000 | [diff] [blame] | 3 | // RUN: %clang -std=c++03 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s |
Richard Smith | 60f0263 | 2011-10-13 21:32:47 +0000 | [diff] [blame] | 4 | // 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 Smith | 460fe6b | 2012-10-17 23:07:52 +0000 | [diff] [blame^] | 8 | // 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 Smith | 60f0263 | 2011-10-13 21:32:47 +0000 | [diff] [blame] | 10 | |
| 11 | void 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 Smith | 460fe6b | 2012-10-17 23:07:52 +0000 | [diff] [blame^] | 27 | |
| 28 | // CXX1Y: undeclared identifier 'typeof' |
| 29 | // CXX1Y-NOT: undeclared identifier 'decltype' |
| 30 | |
| 31 | // GNUXX1Y-NOT: undeclared identifier 'typeof' |
| 32 | // GNUXX1Y-NOT: undeclared identifier 'decltype' |