summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/auto-cxx98.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-09-04 19:54:14 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-09-04 19:54:14 +0000
commit58c743370994da37df3c6ebba76a8277af8483e0 (patch)
tree00d4ed51761297f5bc38225ba635184165444a41 /clang/test/SemaCXX/auto-cxx98.cpp
parente9c4e84f8ea7a8245b1cbb44e158cf0b8d29eb28 (diff)
downloadbcm5719-llvm-58c743370994da37df3c6ebba76a8277af8483e0.tar.gz
bcm5719-llvm-58c743370994da37df3c6ebba76a8277af8483e0.zip
PR10458: Finesse behaviour of C++0x features when in pre-0x mode. Accept for-range and auto with an ExtWarn, and produce a -Wc++0x-compat warning in C++98 mode when auto is used as a storage class.
llvm-svn: 139102
Diffstat (limited to 'clang/test/SemaCXX/auto-cxx98.cpp')
-rw-r--r--clang/test/SemaCXX/auto-cxx98.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/auto-cxx98.cpp b/clang/test/SemaCXX/auto-cxx98.cpp
index fe028114880..8d22469825c 100644
--- a/clang/test/SemaCXX/auto-cxx98.cpp
+++ b/clang/test/SemaCXX/auto-cxx98.cpp
@@ -1,5 +1,8 @@
// RUN: %clang_cc1 -fsyntax-only -verify %s -std=c++98
void f() {
- auto int a;
- int auto b;
+ auto int a; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++0x}}
+ int auto b; // expected-warning {{'auto' storage class specifier is redundant and incompatible with C++0x}}
+ auto c; // expected-warning {{C++0x extension}} expected-error {{requires an initializer}}
+ static auto d = 0; // expected-warning {{C++0x extension}}
+ auto static e = 0; // expected-warning {{C++0x extension}}
}
OpenPOWER on IntegriCloud