forked from OSchip/llvm-project
Sema: attribute((annotate)) must have at least one argument
Sema::handleAnnotateAttr expects that some basic validation is done on the given AttributeList. However, ProcessAccessDeclAttributeList called it directly. Instead, pass the list to ProcessDeclAttribute. This fixes PR21847. llvm-svn: 224204
This commit is contained in:
parent
0cb861634b
commit
706f315e65
|
@ -4802,7 +4802,7 @@ bool Sema::ProcessAccessDeclAttributeList(AccessSpecDecl *ASDecl,
|
|||
const AttributeList *AttrList) {
|
||||
for (const AttributeList* l = AttrList; l; l = l->getNext()) {
|
||||
if (l->getKind() == AttributeList::AT_Annotate) {
|
||||
handleAnnotateAttr(*this, ASDecl, *l);
|
||||
ProcessDeclAttribute(*this, nullptr, ASDecl, *l, l->isCXX11Attribute());
|
||||
} else {
|
||||
Diag(l->getLoc(), diag::err_only_annotate_after_access_spec);
|
||||
return true;
|
||||
|
|
|
@ -5,6 +5,7 @@ public __attribute__((unavailable)): // expected-error {{access specifier can on
|
|||
void foo();
|
||||
private __attribute__((annotate("foobar"))):
|
||||
void bar();
|
||||
private __attribute__((annotate())): // expected-error {{'annotate' attribute takes one argument}}
|
||||
};
|
||||
|
||||
void f(X x) {
|
||||
|
|
Loading…
Reference in New Issue