]> granicus.if.org Git - clang/commitdiff
Partial revert of r206229, to get the build bots green again.
authorAaron Ballman <aaron@aaronballman.com>
Tue, 15 Apr 2014 01:19:35 +0000 (01:19 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 15 Apr 2014 01:19:35 +0000 (01:19 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206237 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Parse/ParseDeclCXX.cpp

index be2349985e52963fce3cd7ddb38b8f93b34db25a..56e116ef3969dac03f3bac4550231f96d2f6bc5b 100644 (file)
@@ -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) {\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;