forked from OSchip/llvm-project
Allow empty argument lists in thread safety attributes
llvm-svn: 146580
This commit is contained in:
parent
8d24618975
commit
36f5d8518b
|
@ -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());
|
||||
}
|
||||
|
|
|
@ -1253,3 +1253,12 @@ public:
|
|||
Mu mu;
|
||||
};
|
||||
|
||||
//-------------------------
|
||||
// Empty argument lists
|
||||
//-------------------------
|
||||
|
||||
class __attribute__((lockable)) EmptyArgListsTest {
|
||||
void lock() __attribute__((exclusive_lock_function())) { }
|
||||
void unlock() __attribute__((unlock_function())) { }
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue