]> granicus.if.org Git - clang/commitdiff
reduce the amount of 'C++ magic' this code depends on :)
authorChris Lattner <sabre@nondot.org>
Thu, 10 Apr 2008 16:37:40 +0000 (16:37 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 10 Apr 2008 16:37:40 +0000 (16:37 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49489 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Parse/DeclSpec.h
lib/Parse/ParseDecl.cpp

index b0efc188ef436b192bad7e997fc37c9ffad9faf2..4de4628950cef4a9ce4407dde63c7714ade39f40 100644 (file)
@@ -670,7 +670,7 @@ public:
 struct FieldDeclarator {
   Declarator D;
   Action::ExprTy *BitfieldSize;
-  FieldDeclarator(DeclSpec &DS) : D(DS, Declarator::MemberContext) {
+  explicit FieldDeclarator(DeclSpec &DS) : D(DS, Declarator::MemberContext) {
     BitfieldSize = 0;
   }
 };
index 1d412482ea90271ca966c0432b373f1d2f000157..804fffb9f13b6050a676da967f31c549abaadd0b 100644 (file)
@@ -677,7 +677,7 @@ ParseStructDeclaration(DeclSpec &DS,
   }
 
   // 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 @@ ParseStructDeclaration(DeclSpec &DS,
     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))