diff options
author | Richard Pennington <rich@pennware.com> | 2010-02-23 12:22:13 +0000 |
---|---|---|
committer | Richard Pennington <rich@pennware.com> | 2010-02-23 12:22:13 +0000 |
commit | 14cc983d86f883e320f27955926f5beeb5385471 (patch) | |
tree | 496d697e20bdc4e52aa35402f053e1e5eda5da6b /clang/lib/Parse/Parser.cpp | |
parent | 7e4acbdf530251544e0237a8a50889acffd972ca (diff) | |
download | bcm5719-llvm-14cc983d86f883e320f27955926f5beeb5385471.tar.gz bcm5719-llvm-14cc983d86f883e320f27955926f5beeb5385471.zip |
Retain attributes for K&R style parameter declarations.
llvm-svn: 96941
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 30899c5dddb..24162373e0e 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -743,10 +743,11 @@ void Parser::ParseKNRParamDeclarations(Declarator &D) { // Handle the full declarator list. while (1) { // If attributes are present, parse them. - llvm::OwningPtr<AttributeList> AttrList; - if (Tok.is(tok::kw___attribute)) - // FIXME: attach attributes too. - AttrList.reset(ParseGNUAttributes()); + if (Tok.is(tok::kw___attribute)) { + SourceLocation Loc; + AttributeList *AttrList = ParseGNUAttributes(&Loc); + ParmDeclarator.AddAttributes(AttrList, Loc); + } // Ask the actions module to compute the type for this declarator. Action::DeclPtrTy Param = |