aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-10 16:37:40 +0000
committerChris Lattner <sabre@nondot.org>2008-04-10 16:37:40 +0000
commitebe457c3443af253bc14ae77c2013b088370a66b (patch)
tree45d42002a81d72c7c8fa45b64e547d022ab02a2a
parentf84afb77a0e948451a521fabde08234e2bd2c646 (diff)
reduce the amount of 'C++ magic' this code depends on :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49489 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Parse/DeclSpec.h2
-rw-r--r--lib/Parse/ParseDecl.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/include/clang/Parse/DeclSpec.h b/include/clang/Parse/DeclSpec.h
index b0efc188ef..4de4628950 100644
--- a/include/clang/Parse/DeclSpec.h
+++ b/include/clang/Parse/DeclSpec.h
@@ -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;
}
};
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp
index 1d412482ea..804fffb9f1 100644
--- a/lib/Parse/ParseDecl.cpp
+++ b/lib/Parse/ParseDecl.cpp
@@ -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))