[PATCH] D124038: [clang] Prevent folding of non-const compound expr
serge via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon May 9 12:39:15 PDT 2022
serge-sans-paille added inline comments.
================
Comment at: clang/lib/AST/ExprConstant.cpp:4267
+ bool IsConstant = CLETy.isConstant(Info.Ctx);
+ if (!IsConstant && CLETy->isArrayType()) {
+ Info.FFDiag(Conv);
----------------
efriedma wrote:
> Is the "isArrayType()" check here necessary?
Yeah, otherwise we have an issue with
```
typedef __attribute__(( ext_vector_type(4) )) float float4;
float4 foo = (float4){ 1.0, 2.0, 3.0, 4.0 };
```
error: cannot compile this static initializer yet
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124038/new/
https://reviews.llvm.org/D124038
More information about the cfe-commits
mailing list