[cfe-commits] r142048 - in /cfe/trunk/lib/Parse: ParseDeclCXX.cpp ParseExprCXX.cpp

Richard Smith richard-llvm at metafoo.co.uk
Fri Oct 14 20:38:41 PDT 2011


Author: rsmith
Date: Fri Oct 14 22:38:41 2011
New Revision: 142048

URL: http://llvm.org/viewvc/llvm-project?rev=142048&view=rev
Log:
Don't warn about use of 'final' in ill-formed C++98 code which didn't use
'final', and don't accept (then silently discard) braced init lists in C++98
new-expressions.

Modified:
    cfe/trunk/lib/Parse/ParseDeclCXX.cpp
    cfe/trunk/lib/Parse/ParseExprCXX.cpp

Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=142048&r1=142047&r2=142048&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Fri Oct 14 22:38:41 2011
@@ -2080,11 +2080,12 @@
       Ident_override = &PP.getIdentifierTable().get("override");
     }
       
-    if (II == Ident_final)
+    if (II == Ident_final) {
       FinalLoc = ConsumeToken();
 
-    if (!getLang().CPlusPlus0x) 
-      Diag(FinalLoc, diag::ext_override_control_keyword) << "final";
+      if (!getLang().CPlusPlus0x) 
+        Diag(FinalLoc, diag::ext_override_control_keyword) << "final";
+    }
   }
 
   if (Tok.is(tok::colon)) {

Modified: cfe/trunk/lib/Parse/ParseExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseExprCXX.cpp?rev=142048&r1=142047&r2=142048&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseExprCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseExprCXX.cpp Fri Oct 14 22:38:41 2011
@@ -2103,7 +2103,7 @@
       SkipUntil(tok::semi, /*StopAtSemi=*/true, /*DontConsume=*/true);
       return ExprError();
     }
-  } else if (Tok.is(tok::l_brace)) {
+  } else if (Tok.is(tok::l_brace) && getLang().CPlusPlus0x) {
     // FIXME: Have to communicate the init-list to ActOnCXXNew.
     ParseBraceInitializer();
   }





More information about the cfe-commits mailing list