[clang] [Clang] Diagnose forming references to nullptr (PR #143667)

Shafik Yaghmour via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 12 20:36:37 PDT 2025


================
@@ -4426,7 +4431,7 @@ static CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E,
 
     // Unless we're looking at a local variable or argument in a constexpr call,
     // the variable we're reading must be const.
-    if (!Frame) {
+    if (AK != clang::AK_ReferenceInitialization && !Frame) {
----------------
shafik wrote:

Can you explain why you are pairing these checks? I am missing the logic, maybe a comment should be added?

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


More information about the cfe-commits mailing list