[clang] [Clang][Interp] Fix handling of `DecompositionDecl` (PR #100400)

2024-07-24 Thread via cfe-commits
@@ -3593,8 +3593,14 @@ VarCreationState Compiler::visitDecl(const VarDecl *VD) { if (R.notCreated()) return R; - if (R) -return true; + if (R) { yronglin wrote: This change just follow current ExprConstant's behavior, but it's no value for this

[clang] [Clang][Interp] Fix handling of `DecompositionDecl` (PR #100400)

2024-07-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang Author: None (yronglin) Changes The following code should be well-formed: ```C++ float decompose_complex(_Complex float cf) { static _Complex float scf; auto &[sre, sim] = scf; // ok, this is references initialized by constant expressions all

[clang] [Clang][Interp] Fix handling of `DecompositionDecl` (PR #100400)

2024-07-24 Thread via cfe-commits
https://github.com/yronglin created https://github.com/llvm/llvm-project/pull/100400 The following code should be well-formed: ```C++ float decompose_complex(_Complex float cf) { static _Complex float scf; auto &[sre, sim] = scf; // ok, this is references initialized by constant expression