diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-08-26 14:27:30 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-08-26 14:27:30 +0000 |
commit | 66a985d16ee1c65a43f27bb56f2e8859c8f5110c (patch) | |
tree | 7f7af57d29015c5bd0d6b4358b26c42a027f38ce /clang/lib | |
parent | c4581eaca8434500e32f19af3ffd4b0fdd111e36 (diff) | |
download | bcm5719-llvm-66a985d16ee1c65a43f27bb56f2e8859c8f5110c.tar.gz bcm5719-llvm-66a985d16ee1c65a43f27bb56f2e8859c8f5110c.zip |
Fix bug in __extension__ handling for declarations, from Abramo
Bagnara with a fix from Enea Zaffanella!
llvm-svn: 80094
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Parse/ParseDecl.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/clang/lib/Parse/ParseDecl.cpp b/clang/lib/Parse/ParseDecl.cpp index 8cb8ffdd054..c29f601f299 100644 --- a/clang/lib/Parse/ParseDecl.cpp +++ b/clang/lib/Parse/ParseDecl.cpp @@ -1509,10 +1509,19 @@ void Parser::ParseStructUnionBody(SourceLocation RecordLoc, // Convert them all to fields. for (unsigned i = 0, e = FieldDeclarators.size(); i != e; ++i) { FieldDeclarator &FD = FieldDeclarators[i]; + DeclPtrTy Field; // Install the declarator into the current TagDecl. - DeclPtrTy Field = Actions.ActOnField(CurScope, TagDecl, - DS.getSourceRange().getBegin(), - FD.D, FD.BitfieldSize); + if (FD.D.getExtension()) { + // Silences extension warnings + ExtensionRAIIObject O(Diags); + Field = Actions.ActOnField(CurScope, TagDecl, + DS.getSourceRange().getBegin(), + FD.D, FD.BitfieldSize); + } else { + Field = Actions.ActOnField(CurScope, TagDecl, + DS.getSourceRange().getBegin(), + FD.D, FD.BitfieldSize); + } FieldDecls.push_back(Field); } } else { // Handle @defs @@ -2016,6 +2025,8 @@ void Parser::ParseDeclarator(Declarator &D) { void Parser::ParseDeclaratorInternal(Declarator &D, DirectDeclParseFunction DirectDeclParser) { + if (Diags.hasAllExtensionsSilenced()) + D.setExtension(); // C++ member pointers start with a '::' or a nested-name. // Member pointers get special handling, since there's no place for the // scope spec in the generic path below. |