diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-09-04 19:54:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2011-09-04 19:54:14 +0000 |
commit | 8f4fb190852d3f86787c7e2c3dfc1b96143197ae (patch) | |
tree | 0873e06df83057b59020723b625f72faec6ad157 /lib/Parse/ParseStmt.cpp | |
parent | 74e611a5fd0b5977c664d13a07b625ae23527d0d (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139102 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 7ad48a1f5d..e400ed1391 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -1313,6 +1313,9 @@ StmtResult Parser::ParseForStatement(ParsedAttributes &attrs) { FirstPart = Actions.ActOnDeclStmt(DG, DeclStart, Tok.getLocation()); if (ForRangeInit.ParsedForRangeDecl()) { + if (!getLang().CPlusPlus0x) + Diag(ForRangeInit.ColonLoc, diag::ext_for_range); + ForRange = true; } else if (Tok.is(tok::semi)) { // for (int x = 4; ConsumeToken(); |