forked from OSchip/llvm-project
Partial revert of r206229, to get the build bots green again.
llvm-svn: 206237
This commit is contained in:
parent
97c05b52b4
commit
9e3d7bd20b
|
@ -3254,14 +3254,15 @@ bool Parser::ParseCXX11AttributeArgs(IdentifierInfo *AttrName,
|
|||
// parsing an argument list, we need to determine whether this attribute
|
||||
// was allowed to have an argument list (such as [[deprecated]]), and how
|
||||
// many arguments were parsed (so we can diagnose on [[deprecated()]]).
|
||||
if (!NumArgs) {
|
||||
// Diagnose an empty argument list when parenthesis are present.
|
||||
// FIXME: This is a good place for a fixit which removes the parens.
|
||||
Diag(LParenLoc, diag::err_attribute_requires_arguments) << AttrName;
|
||||
return false;
|
||||
} else if (NumArgs && !Attr->getMaxArgs()) {
|
||||
// The attribute parsed successfully, but was not allowed to have any
|
||||
// arguments. It doesn't matter whether any were provided -- the
|
||||
if (Attr->getMaxArgs() && !NumArgs) {
|
||||
// The attribute was allowed to have arguments, but none were provided
|
||||
// even though the attribute parsed successfully. This is an error.
|
||||
// FIXME: This is a good place for a fixit which removes the parens.
|
||||
Diag(LParenLoc, diag::err_attribute_requires_arguments) << AttrName;
|
||||
return false;
|
||||
} else if (!Attr->getMaxArgs()) {
|
||||
// The attribute parsed successfully, but was not allowed to have any
|
||||
// arguments. It doesn't matter whether any were provided -- the
|
||||
// presence of the argument list (even if empty) is diagnosed.
|
||||
Diag(LParenLoc, diag::err_cxx11_attribute_forbids_arguments)
|
||||
<< AttrName;
|
||||
|
|
Loading…
Reference in New Issue