Re: [PATCH] c++: ICE initing lifetime-extended constexpr var [PR107079]

2023-02-08 Thread Jason Merrill via Gcc-patches
On 2/8/23 13:01, Marek Polacek wrote: (This may not be a complete fix but I got stuck so I'm posting what I have, which at least fixes the ICE.) We ICE on the simple: struct X { const X* x = this; }; constexpr const X& x = X{}; where store_init_value initializes 'x' with &TARGET_EXPR

[PATCH] c++: ICE initing lifetime-extended constexpr var [PR107079]

2023-02-08 Thread Marek Polacek via Gcc-patches
(This may not be a complete fix but I got stuck so I'm posting what I have, which at least fixes the ICE.) We ICE on the simple: struct X { const X* x = this; }; constexpr const X& x = X{}; where store_init_value initializes 'x' with &TARGET_EXPR }> but we must lifetime-extend via extend