summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseDeclCXX.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2014-04-15 01:19:35 +0000
committerAaron Ballman <aaron@aaronballman.com>2014-04-15 01:19:35 +0000
commit9e3d7bd20bc2060d082bf6b9177196b67009421c (patch)
tree8056e9a8deaa1d390d084e3b78d3178379eb4156 /clang/lib/Parse/ParseDeclCXX.cpp
parent97c05b52b404cac38eea383b55821e324e5abbac (diff)
downloadbcm5719-llvm-9e3d7bd20bc2060d082bf6b9177196b67009421c.tar.gz
bcm5719-llvm-9e3d7bd20bc2060d082bf6b9177196b67009421c.zip
Partial revert of r206229, to get the build bots green again.
llvm-svn: 206237
Diffstat (limited to 'clang/lib/Parse/ParseDeclCXX.cpp')
-rw-r--r--clang/lib/Parse/ParseDeclCXX.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/clang/lib/Parse/ParseDeclCXX.cpp b/clang/lib/Parse/ParseDeclCXX.cpp
index be2349985e5..56e116ef396 100644
--- a/clang/lib/Parse/ParseDeclCXX.cpp
+++ b/clang/lib/Parse/ParseDeclCXX.cpp
@@ -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;
OpenPOWER on IntegriCloud