blob: 7704c8dda1ead8706615e5f4aec625f6950b3367 [file] [log] [blame]
Richard Smith0b1b5b82011-10-13 21:32:47 +00001// 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 Smith78f0ea72011-10-14 00:34:28 +00003// RUN: %clang -std=c++03 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
Richard Smith0b1b5b82011-10-13 21:32:47 +00004// 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
8
9void f(int n) {
10 typeof(n)();
11 decltype(n)();
12}
13
14// CXX98: undeclared identifier 'typeof'
15// CXX98: undeclared identifier 'decltype'
16
17// GNUXX98-NOT: undeclared identifier 'typeof'
18// GNUXX98: undeclared identifier 'decltype'
19
20// CXX11: undeclared identifier 'typeof'
21// CXX11-NOT: undeclared identifier 'decltype'
22
23// GNUXX11-NOT: undeclared identifier 'typeof'
24// GNUXX11-NOT: undeclared identifier 'decltype'