rsmith added a comment. Thanks, nice catch!
Can we also add an assert when parsing a `for` statement that we actually find a range if the tentative parse said we were expecting one? ================ Comment at: clang/test/CodeGenCXX/for-loop-init-ternary-operator-statement.cpp:1 +// RUN: %clang_cc1 -triple i386-unknown-unknown -O3 -emit-llvm -o - %s | FileCheck %s + ---------------- We don't use `-O3` tests for this kind of thing, to avoid depending on the behaviour of the optimizer; instead you should test that the (unoptimized) IR generated by clang is correct. ================ Comment at: clang/test/PCH/for-loop-init-ternary-operator-statement.cpp:5 +int f() { + // CHECK: for (int i = 0; x; i++) { + for (int i = 0; int x = i < 2 ? 1 : 0; i++) { ---------------- This ast-print output looks wrong; I assume that's an unrelated bug? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102502/new/ https://reviews.llvm.org/D102502 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits