aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-10-13 21:32:47 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-10-13 21:32:47 +0000
commit0b1b5b89cc8b63aa3192a1c94e712e8a9b1a006f (patch)
tree8f1847207a5146b9e381502251ab6facc6cd449e
parent84cbd4b0a924b3a741bab88c0dd4fd16f3f14b68 (diff)
Add test for new -std=c++11 and -std=gnu++11 command-line arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141891 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Driver/std.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/Driver/std.cpp b/test/Driver/std.cpp
new file mode 100644
index 0000000000..99deb11365
--- /dev/null
+++ b/test/Driver/std.cpp
@@ -0,0 +1,23 @@
+// RUN: %clang -std=c++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %s
+// RUN: %clang -std=gnu++98 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX98 %s
+// RUN: %clang -std=c++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
+// RUN: %clang -std=gnu++0x %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
+// RUN: %clang -std=c++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX11 %s
+// RUN: %clang -std=gnu++11 %s -fsyntax-only 2>&1 | FileCheck -check-prefix=GNUXX11 %s
+
+void f(int n) {
+ typeof(n)();
+ decltype(n)();
+}
+
+// CXX98: undeclared identifier 'typeof'
+// CXX98: undeclared identifier 'decltype'
+
+// GNUXX98-NOT: undeclared identifier 'typeof'
+// GNUXX98: undeclared identifier 'decltype'
+
+// CXX11: undeclared identifier 'typeof'
+// CXX11-NOT: undeclared identifier 'decltype'
+
+// GNUXX11-NOT: undeclared identifier 'typeof'
+// GNUXX11-NOT: undeclared identifier 'decltype'