efriedma-quic wrote: Here's a testcase that's should generate a diagnostic, but doesn't without this patch:
``` int &ff(); int &x = ff(); constinit int &z = x; ``` Some related testcases are a little weird... consider the following: ``` extern int &x; int &z = x; ``` There's a gap between checking for constant expressions, and codegen, due to the following diagnostic; it triggers in constexpr, but allows evaluating for the value because a CCEDiag doesn't stop the evaluation: https://github.com/llvm/llvm-project/blob/52c81598da38532c119db9c06fcc3d7f9c332a8e/clang/lib/AST/ExprConstant.cpp#L3607 . https://github.com/llvm/llvm-project/pull/128409 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits