MitalAshok wrote: Hmm. On reading https://eel.is/c++draft/meta.const.eval#4 again, it says:
> *Remarks*: During the evaluation of an expression `E` as a core constant > expression, a call to this function is ill-formed unless `p` points to an > object that is usable in constant expressions or whose complete object's > lifetime began within `E`. So calling it inside constructors before the complete-object's lifetime has began (<https://eel.is/c++draft/basic.life#1.2>) should be ill-formed (instead of the current behaviour of `false`) But I'm unsure about dangling pointers. The complete object's lifetime had begun, but it also ended. And https://cplusplus.github.io/CWG/issues/2822.html seems to make it implementation defined to use the pointer https://github.com/llvm/llvm-project/pull/91895 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits