blob: aceda017a4e1aba8b06f9eb397c5edb36beb4ff2 [file] [log] [blame]
Rafael Espindola925213b2013-07-04 16:16:58 +00001// 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 Smithdbd4d4c2014-06-16 15:16:56 +000010// 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 Smith60f02632011-10-13 21:32:47 +000012
13void 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 Smith460fe6b2012-10-17 23:07:52 +000029
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 Smithdbd4d4c2014-06-16 15:16:56 +000035
36// CXX1Z: undeclared identifier 'typeof'
37// CXX1Z-NOT: undeclared identifier 'decltype'
38
39// GNUXX1Z-NOT: undeclared identifier 'typeof'
40// GNUXX1Z-NOT: undeclared identifier 'decltype'