aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2016-03-31 09:13:44 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2016-03-31 09:13:44 +0000
commit05968174c3c99b075dda38ff860d4ca8c4e7990e (patch)
tree79b92f55aec328f63b2226256b3cea761255166d /clang/lib/Parse/ParseOpenMP.cpp
parent6221be8e461ef5ce6cba05904260f697ce09eb81 (diff)
downloadllvm-05968174c3c99b075dda38ff860d4ca8c4e7990e.zip
llvm-05968174c3c99b075dda38ff860d4ca8c4e7990e.tar.gz
llvm-05968174c3c99b075dda38ff860d4ca8c4e7990e.tar.bz2
[OPENMP] Allow skip expression after comma in clauses with lists.
Compatibility fix for better compatibility with the existing software. llvm-svn: 265003
Diffstat (limited to 'clang/lib/Parse/ParseOpenMP.cpp')
-rw-r--r--clang/lib/Parse/ParseOpenMP.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 96cf379..68e725c 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -1414,17 +1414,18 @@ OMPClause *Parser::ParseOpenMPVarListClause(OpenMPDirectiveKind DKind,
// Parse variable
ExprResult VarExpr =
Actions.CorrectDelayedTyposInExpr(ParseAssignmentExpression());
- if (VarExpr.isUsable()) {
+ if (VarExpr.isUsable())
Vars.push_back(VarExpr.get());
- } else {
+ else {
SkipUntil(tok::comma, tok::r_paren, tok::annot_pragma_openmp_end,
StopBeforeMatch);
}
// Skip ',' if any
IsComma = Tok.is(tok::comma);
- if (IsComma)
+ if (IsComma) {
ConsumeToken();
- else if (Tok.isNot(tok::r_paren) &&
+ IsComma = false;
+ } else if (Tok.isNot(tok::r_paren) &&
Tok.isNot(tok::annot_pragma_openmp_end) &&
(!MayHaveTail || Tok.isNot(tok::colon)))
Diag(Tok, diag::err_omp_expected_punc)