r206237 - Partial revert of r206229, to get the build bots green again.

Aaron Ballman aaron at aaronballman.com
Mon Apr 14 18:19:35 PDT 2014


Author: aaronballman
Date: Mon Apr 14 20:19:35 2014
New Revision: 206237

URL: http://llvm.org/viewvc/llvm-project?rev=206237&view=rev
Log:
Partial revert of r206229, to get the build bots green again.

Modified:
    cfe/trunk/lib/Parse/ParseDeclCXX.cpp

Modified: cfe/trunk/lib/Parse/ParseDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseDeclCXX.cpp?rev=206237&r1=206236&r2=206237&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseDeclCXX.cpp (original)
+++ cfe/trunk/lib/Parse/ParseDeclCXX.cpp Mon Apr 14 20:19:35 2014
@@ -3254,14 +3254,15 @@ bool Parser::ParseCXX11AttributeArgs(Ide
       // 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;





More information about the cfe-commits mailing list