[cfe-commits] r49489 - in /cfe/trunk: include/clang/Parse/DeclSpec.h lib/Parse/ParseDecl.cpp

Chris Lattner sabre at nondot.org
Thu Apr 10 09:37:40 PDT 2008


Author: lattner
Date: Thu Apr 10 11:37:40 2008
New Revision: 49489

URL: http://llvm.org/viewvc/llvm-project?rev=49489&view=rev
Log:
reduce the amount of 'C++ magic' this code depends on :)


Modified:
    cfe/trunk/include/clang/Parse/DeclSpec.h
    cfe/trunk/lib/Parse/ParseDecl.cpp

Modified: cfe/trunk/include/clang/Parse/DeclSpec.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Parse/DeclSpec.h?rev=49489&r1=49488&r2=49489&view=diff

==============================================================================
--- cfe/trunk/include/clang/Parse/DeclSpec.h (original)
+++ cfe/trunk/include/clang/Parse/DeclSpec.h Thu Apr 10 11:37:40 2008
@@ -670,7 +670,7 @@
 struct FieldDeclarator {
   Declarator D;
   Action::ExprTy *BitfieldSize;
-  FieldDeclarator(DeclSpec &DS) : D(DS, Declarator::MemberContext) {
+  explicit FieldDeclarator(DeclSpec &DS) : D(DS, Declarator::MemberContext) {
     BitfieldSize = 0;
   }
 };

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

==============================================================================
--- cfe/trunk/lib/Parse/ParseDecl.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDecl.cpp Thu Apr 10 11:37:40 2008
@@ -677,7 +677,7 @@
   }
 
   // Read struct-declarators until we find the semicolon.
-  Fields.push_back(DS);
+  Fields.push_back(FieldDeclarator(DS));
   while (1) {
     FieldDeclarator &DeclaratorInfo = Fields.back();
     
@@ -708,7 +708,7 @@
     ConsumeToken();
     
     // Parse the next declarator.
-    Fields.push_back(DS);
+    Fields.push_back(FieldDeclarator(DS));
     
     // Attributes are only allowed on the second declarator.
     if (Tok.is(tok::kw___attribute))





More information about the cfe-commits mailing list