// 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) {\r
+ // The attribute was allowed to have arguments, but none were provided\r
+ // even though the attribute parsed successfully. This is an error.\r
+ // FIXME: This is a good place for a fixit which removes the parens.\r
+ Diag(LParenLoc, diag::err_attribute_requires_arguments) << AttrName;\r
+ return false;\r
+ } else if (!Attr->getMaxArgs()) {\r
+ // The attribute parsed successfully, but was not allowed to have any\r
+ // arguments. It doesn't matter whether any were provided -- the\r
// presence of the argument list (even if empty) is diagnosed.
Diag(LParenLoc, diag::err_cxx11_attribute_forbids_arguments)
<< AttrName;