summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2011-09-04 20:24:20 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2011-09-04 20:24:20 +0000
commit5065864151d7c00292a42c978a39bdf81fe2c02c (patch)
tree0fc4f3a716e7b318ac8a16c646c7eba7a5479feb /clang/lib
parent58c743370994da37df3c6ebba76a8277af8483e0 (diff)
downloadbcm5719-llvm-5065864151d7c00292a42c978a39bdf81fe2c02c.tar.gz
bcm5719-llvm-5065864151d7c00292a42c978a39bdf81fe2c02c.zip
PR10458: Last part of providing 'auto' type specifier as an extension in C++98: permit it within type-ids.
llvm-svn: 139103
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Parse/ParseDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp
index ad649a3c225..4928bde0022 100644
--- a/clang/lib/Parse/ParseDecl.cpp
+++ b/clang/lib/Parse/ParseDecl.cpp
@@ -2265,7 +2265,11 @@ bool Parser::ParseOptionalTypeSpecifier(DeclSpec &DS, bool& isInvalid,
// C++0x auto support.
case tok::kw_auto:
- if (!getLang().CPlusPlus0x)
+ // This is only called in situations where a storage-class specifier is
+ // illegal, so we can assume an auto type specifier was intended even in
+ // C++98. In C++98 mode, DeclSpec::Finish will produce an appropriate
+ // extension diagnostic.
+ if (!getLang().CPlusPlus)
return false;
isInvalid = DS.SetTypeSpecType(DeclSpec::TST_auto, Loc, PrevSpec, DiagID);
OpenPOWER on IntegriCloud