diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-13 21:32:47 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-10-13 21:32:47 +0000 |
| commit | 60f0263596d3308f300da9999fcbd3d849fac92f (patch) | |
| tree | 508aee612ebef7b6eb12efa70e589736d3498b50 | |
| parent | 742549f8effa950ca52b0c549aa93fd03a82f334 (diff) | |
| download | bcm5719-llvm-60f0263596d3308f300da9999fcbd3d849fac92f.tar.gz bcm5719-llvm-60f0263596d3308f300da9999fcbd3d849fac92f.zip | |
Add test for new -std=c++11 and -std=gnu++11 command-line arguments.
llvm-svn: 141891
| -rw-r--r-- | clang/test/Driver/std.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/test/Driver/std.cpp b/clang/test/Driver/std.cpp new file mode 100644 index 00000000000..99deb11365e --- /dev/null +++ b/clang/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' |

