From: Alexey Bataev Date: Wed, 5 Mar 2014 06:53:13 +0000 (+0000) Subject: [OPENMP] emit error message for clause 'if(1 0)' X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0661f6d435fd4f159d7383291816eb90a621cc2d;p=clang [OPENMP] emit error message for clause 'if(1 0)' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202942 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Parse/ParseOpenMP.cpp b/lib/Parse/ParseOpenMP.cpp index 3a8f2ee880..df8f17bd13 100644 --- a/lib/Parse/ParseOpenMP.cpp +++ b/lib/Parse/ParseOpenMP.cpp @@ -330,10 +330,6 @@ OMPClause *Parser::ParseOpenMPSingleExprClause(OpenMPClauseKind Kind) { ExprResult LHS(ParseCastExpression(false, false, NotTypeCast)); ExprResult Val(ParseRHSOfBinaryExpression(LHS, prec::Conditional)); - if (Tok.isNot(tok::r_paren) && Tok.isNot(tok::comma) && - Tok.isNot(tok::annot_pragma_openmp_end)) - ConsumeAnyToken(); - // Parse ')'. T.consumeClose(); diff --git a/test/OpenMP/parallel_if_messages.cpp b/test/OpenMP/parallel_if_messages.cpp index eb4180d7f5..97096dfae3 100644 --- a/test/OpenMP/parallel_if_messages.cpp +++ b/test/OpenMP/parallel_if_messages.cpp @@ -20,6 +20,7 @@ int tmain(T argc, S **argv) { #pragma omp parallel if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp parallel' cannot contain more than one 'if' clause}} #pragma omp parallel if (S) // expected-error {{'S' does not refer to a value}} #pragma omp parallel if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp parallel if(argc) foo(); @@ -36,6 +37,8 @@ int main(int argc, char **argv) { #pragma omp parallel if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp parallel' cannot contain more than one 'if' clause}} #pragma omp parallel if (S1) // expected-error {{'S1' does not refer to a value}} #pragma omp parallel if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}} + #pragma omp parallel if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}} #pragma omp parallel if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}} foo();