diff options
author | Chris Lattner <sabre@nondot.org> | 2009-12-10 01:59:24 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-12-10 01:59:24 +0000 |
commit | 17c3b1f2785e3d2b0344b4da9c18f98efc5d0cef (patch) | |
tree | 0a6605c92a14f7f31537c35205b0d2cbad5f98b4 /clang/lib/Parse/ParseDecl.cpp | |
parent | fefc7b8e7bdf80b9e02ef002a3a9a7cafa84c121 (diff) | |
download | bcm5719-llvm-17c3b1f2785e3d2b0344b4da9c18f98efc5d0cef.tar.gz bcm5719-llvm-17c3b1f2785e3d2b0344b4da9c18f98efc5d0cef.zip |
fix incorrect parsing of bitfields pointed out by Doug. I chose
to use ColonProtectionRAIIObject in the C codepath even though it
won't matter for consistency.
llvm-svn: 91037
Diffstat (limited to 'clang/lib/Parse/ParseDecl.cpp')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 5a657dea9b2..2a6a0494e57 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1,4 +1,3 @@ - //===--- ParseDecl.cpp - Declaration Parsing ------------------------------===// // // The LLVM Compiler Infrastructure @@ -1545,8 +1544,11 @@ ParseStructDeclaration(DeclSpec &DS, FieldCallback &Fields) { /// struct-declarator: declarator /// struct-declarator: declarator[opt] ':' constant-expression - if (Tok.isNot(tok::colon)) + if (Tok.isNot(tok::colon)) { + // Don't parse FOO:BAR as if it were a typo for FOO::BAR. + ColonProtectionRAIIObject X(*this); ParseDeclarator(DeclaratorInfo.D); + } if (Tok.is(tok::colon)) { ConsumeToken(); |