[clang] [clang] fix constexpr-unknown handling of self-references. (PR #132990)

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 26 12:06:34 PDT 2025


================
@@ -3629,17 +3644,17 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E,
 
   Result = VD->getEvaluatedValue();
 
-  // C++23 [expr.const]p8
-  // ... For such an object that is not usable in constant expressions, the
-  // dynamic type of the object is constexpr-unknown. For such a reference that
-  // is not usable in constant expressions, the reference is treated as binding
-  // to an unspecified object of the referenced type whose lifetime and that of
-  // all subobjects includes the entire constant evaluation and whose dynamic
-  // type is constexpr-unknown.
----------------
efriedma-quic wrote:

The comment didn't make sense at that location in the code, given the refactoring.  I could stick something into CheckUninitReference, I guess.

https://github.com/llvm/llvm-project/pull/132990


More information about the cfe-commits mailing list