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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224204
91177308-0d34-0410-b5e6-
96231b3b80d8
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;
void foo();
private __attribute__((annotate("foobar"))):
void bar();
+private __attribute__((annotate())): // expected-error {{'annotate' attribute takes one argument}}
};
void f(X x) {