[PATCH] D102502: [clang] Fix ternary operator in second for loop argument

Danila Kutenin via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 14 08:45:10 PDT 2021


danlark added a comment.

In D102502#2759776 <https://reviews.llvm.org/D102502#2759776>, @lebedev.ri wrote:

> This should have codegen, and maybe AST, tests.

Will add shortly



================
Comment at: clang/test/Parser/cxx2a-init-statement.cpp:18
 
+  for (int i = 0; int x = i < 2 ? 1 : 0; i++) {}
+
----------------
lebedev.ri wrote:
> This isn't cxx2a-specific isn't it?
> Isn't this valid even in C99?
clang even in C++11 versions go to this branch and produce warning that this feature is c++2a, so it fails currently for everything but the culprit was https://github.com/llvm/llvm-project/commit/8baa50013c86c34a58d8327c5d1a043898b86398


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102502/new/

https://reviews.llvm.org/D102502



More information about the cfe-commits mailing list