From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/test/Driver/std.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 clang/test/Driver/std.cpp (limited to 'clang/test/Driver/std.cpp') diff --git a/clang/test/Driver/std.cpp b/clang/test/Driver/std.cpp new file mode 100644 index 0000000..7704c8d --- /dev/null +++ b/clang/test/Driver/std.cpp @@ -0,0 +1,24 @@ +// 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++03 %s -Wno-c++0x-compat -fsyntax-only 2>&1 | FileCheck -check-prefix=CXX98 %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' -- cgit v1.2.3