diff options
author | DeLesley Hutchins <delesley@google.com> | 2011-12-14 19:36:06 +0000 |
---|---|---|
committer | DeLesley Hutchins <delesley@google.com> | 2011-12-14 19:36:06 +0000 |
commit | 4805f158203017bdf575003235473284134c1071 (patch) | |
tree | 5b4cf0c1fe2a91ff607363154f770eb5712ef9e1 /lib/Parse/ParseDecl.cpp | |
parent | 76178ed0911797175b13ac733c390233f02bb841 (diff) |
Allow empty argument lists in thread safety attributes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146580 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseDecl.cpp')
-rw-r--r-- | lib/Parse/ParseDecl.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Parse/ParseDecl.cpp b/lib/Parse/ParseDecl.cpp index ff3084d0cb..9644d62bd2 100644 --- a/lib/Parse/ParseDecl.cpp +++ b/lib/Parse/ParseDecl.cpp @@ -843,7 +843,7 @@ void Parser::ParseThreadSafetyAttribute(IdentifierInfo &AttrName, bool ArgExprsOk = true; // now parse the list of expressions - while (1) { + while (Tok.isNot(tok::r_paren)) { ExprResult ArgExpr(ParseAssignmentExpression()); if (ArgExpr.isInvalid()) { ArgExprsOk = false; @@ -857,7 +857,7 @@ void Parser::ParseThreadSafetyAttribute(IdentifierInfo &AttrName, ConsumeToken(); // Eat the comma, move to the next argument } // Match the ')'. - if (ArgExprsOk && !T.consumeClose()) { + if (ArgExprsOk && !T.consumeClose() && ArgExprs.size() > 0) { Attrs.addNew(&AttrName, AttrNameLoc, 0, AttrNameLoc, 0, SourceLocation(), ArgExprs.take(), ArgExprs.size()); } |