Retain attributes for K&R style parameter declarations.
llvm-svn: 96941
This commit is contained in:
parent
7e4acbdf53
commit
14cc983d86
|
@ -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 =
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -W -Wall -Werror -verify %s
|
||||
|
||||
int f(int i __attribute__((__unused__)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
int g(i)
|
||||
int i __attribute__((__unused__));
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue