[cfe-commits] r68920 - /cfe/trunk/lib/Parse/ParseDecl.cpp

Chris Lattner sabre at nondot.org
Sun Apr 12 15:29:43 PDT 2009


Author: lattner
Date: Sun Apr 12 17:29:43 2009
New Revision: 68920

URL: http://llvm.org/viewvc/llvm-project?rev=68920&view=rev
Log:
add support for handling C++'0x unified initializer syntax
to isValidAfterIdentifierInDeclarator, as suggested by Sebastian.

Modified:
    cfe/trunk/lib/Parse/ParseDecl.cpp

Modified: cfe/trunk/lib/Parse/ParseDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDecl.cpp?rev=68920&r1=68919&r2=68920&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Sun Apr 12 17:29:43 2009
@@ -475,6 +475,7 @@
 ///      int x   =             17;         // init-declarator-list
 ///      int x   ,             y;          // init-declarator-list
 ///      int x   __asm__       ("foo");    // init-declarator-list
+///      int x   {             5};         // C++'0x unified initializers
 ///
 /// This is not, because 'x' does not immediately follow the declspec (though
 /// ')' happens to be valid anyway).
@@ -483,8 +484,7 @@
 static bool isValidAfterIdentifierInDeclarator(const Token &T) {
   return T.is(tok::l_square) || T.is(tok::l_paren) || T.is(tok::r_paren) ||
          T.is(tok::semi) || T.is(tok::comma) || T.is(tok::equal) ||
-         T.is(tok::kw_asm);
-    
+         T.is(tok::kw_asm) || T.is(tok::l_brace);
 }
 
 /// ParseDeclarationSpecifiers





More information about the cfe-commits mailing list