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
12 lines
223 B
C++
12 lines
223 B
C++
// RUN: %clang_cc1 -emit-pch -o %t %s
|
|
// RUN: %clang_cc1 -x ast -ast-print %t | FileCheck %s
|
|
|
|
int f() {
|
|
// CHECK: for (int i = 0; x; i++) {
|
|
for (int i = 0; int x = i < 2 ? 1 : 0; i++) {
|
|
return x;
|
|
}
|
|
return 0;
|
|
}
|
|
|