aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Parse/ParseTentative.cpp
diff options
context:
space:
mode:
authorDanila Kutenin <kutdanila@yandex.ru>2021-05-14 16:56:48 -0700
committerRichard Smith <richard@metafoo.co.uk>2021-05-16 10:42:52 -0700
commitd29f7f1a7b47345289d63318e7b2a28cc56e169d (patch)
treebbad158cc1b261d46f3d85001741a23b4c89c24d /clang/lib/Parse/ParseTentative.cpp
parentd1a7630369bc489ca85e7fd0e05119a6d6f09039 (diff)
downloadllvm-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.cpp2
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))