diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 9cace20ee190..6cc79fff3eac 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -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; diff --git a/clang/test/Parser/access-spec-attrs.cpp b/clang/test/Parser/access-spec-attrs.cpp index 4fa597581165..2958e385f8b5 100644 --- a/clang/test/Parser/access-spec-attrs.cpp +++ b/clang/test/Parser/access-spec-attrs.cpp @@ -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) {