mirror of https://github.com/microsoft/clang.git
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@224204 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a3078700de
commit
81fcac7206
|
@ -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