forked from OSchip/llvm-project
Fix attribute between function decl ')' and '{' or '=0'
llvm-svn: 89894
This commit is contained in:
parent
8981b3abe5
commit
5bc5cbe2a2
|
@ -1144,6 +1144,13 @@ void Parser::ParseCXXClassMemberDeclaration(AccessSpecifier AS,
|
|||
return;
|
||||
}
|
||||
|
||||
// If attributes exist after the declarator, but before an '{', parse them.
|
||||
if (Tok.is(tok::kw___attribute)) {
|
||||
SourceLocation Loc;
|
||||
AttributeList *AttrList = ParseGNUAttributes(&Loc);
|
||||
DeclaratorInfo.AddAttributes(AttrList, Loc);
|
||||
}
|
||||
|
||||
// function-definition:
|
||||
if (Tok.is(tok::l_brace)
|
||||
|| (DeclaratorInfo.isFunctionDeclarator() &&
|
||||
|
|
|
@ -51,3 +51,4 @@ int foo42(void) {
|
|||
// rdar://6096491
|
||||
void __attribute__((noreturn)) d0(void), __attribute__((noreturn)) d1(void);
|
||||
|
||||
void d2(void) __attribute__((noreturn)), d3(void) __attribute__((noreturn));
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
// RUN: clang-cc -fsyntax-only -verify %s
|
||||
|
||||
class c {
|
||||
virtual void f1(const char* a, ...)
|
||||
__attribute__ (( __format__(__printf__,2,3) )) = 0;
|
||||
virtual void f2(const char* a, ...)
|
||||
__attribute__ (( __format__(__printf__,2,3) )) {}
|
||||
};
|
||||
|
Loading…
Reference in New Issue