blob: 52b42ab9bd4fdc4a02427c49d6802c61ba34080c [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
Faisal Vali5f475b92017-07-16 00:23:04 +000012// 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
Richard Smith60f02632011-10-13 21:32:47 +000015
16void f(int n) {
17 typeof(n)();
18 decltype(n)();
19}
20
21// CXX98: undeclared identifier 'typeof'
22// CXX98: undeclared identifier 'decltype'
23
24// GNUXX98-NOT: undeclared identifier 'typeof'
25// GNUXX98: undeclared identifier 'decltype'
26
27// CXX11: undeclared identifier 'typeof'
28// CXX11-NOT: undeclared identifier 'decltype'
29
30// GNUXX11-NOT: undeclared identifier 'typeof'
31// GNUXX11-NOT: undeclared identifier 'decltype'
Richard Smith460fe6b2012-10-17 23:07:52 +000032
33// CXX1Y: undeclared identifier 'typeof'
34// CXX1Y-NOT: undeclared identifier 'decltype'
35
36// GNUXX1Y-NOT: undeclared identifier 'typeof'
37// GNUXX1Y-NOT: undeclared identifier 'decltype'
Richard Smithdbd4d4c2014-06-16 15:16:56 +000038
39// CXX1Z: undeclared identifier 'typeof'
40// CXX1Z-NOT: undeclared identifier 'decltype'
41
42// GNUXX1Z-NOT: undeclared identifier 'typeof'
43// GNUXX1Z-NOT: undeclared identifier 'decltype'
Faisal Vali5f475b92017-07-16 00:23:04 +000044
45// CXX2A: undeclared identifier 'typeof'
46// CXX2A-NOT: undeclared identifier 'decltype'
47
48// GNUXX2A-NOT: undeclared identifier 'typeof'
49// GNUXX2A-NOT: undeclared identifier 'decltype'
50