diff options
author | Danila Kutenin <kutdanila@yandex.ru> | 2021-05-14 16:56:48 -0700 |
---|---|---|
committer | Richard Smith <richard@metafoo.co.uk> | 2021-05-16 10:42:52 -0700 |
commit | d29f7f1a7b47345289d63318e7b2a28cc56e169d (patch) | |
tree | bbad158cc1b261d46f3d85001741a23b4c89c24d /clang/lib/Parse/ParseTentative.cpp | |
parent | d1a7630369bc489ca85e7fd0e05119a6d6f09039 (diff) | |
download | llvm-d29f7f1a7b47345289d63318e7b2a28cc56e169d.zip llvm-d29f7f1a7b47345289d63318e7b2a28cc56e169d.tar.gz llvm-d29f7f1a7b47345289d63318e7b2a28cc56e169d.tar.bz2 |
[clang] Fix ternary operator in the second for loop statement
Fix ternary operator in for loop argument, it was by mistake not set as CanBeForRangeDecl and led to incorrect codegen. It fixes https://bugs.llvm.org/show_bug.cgi?id=50038. I don't have commit rights. Danila Kutenin. kutdanila@yandex.ru
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D102502
Diffstat (limited to 'clang/lib/Parse/ParseTentative.cpp')
-rw-r--r-- | clang/lib/Parse/ParseTentative.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp index 3bf2bc4..c0bfbbd 100644 --- a/clang/lib/Parse/ParseTentative.cpp +++ b/clang/lib/Parse/ParseTentative.cpp @@ -353,8 +353,8 @@ struct Parser::ConditionDeclarationOrInitStatementState { if (CanBeForRangeDecl) { // Skip until we hit a ')', ';', or a ':' with no matching '?'. // The final case is a for range declaration, the rest are not. + unsigned QuestionColonDepth = 0; while (true) { - unsigned QuestionColonDepth = 0; P.SkipUntil({tok::r_paren, tok::semi, tok::question, tok::colon}, StopBeforeMatch); if (P.Tok.is(tok::question)) |