Re: [PATCH 2/2] c++: -Wdangling-reference diagnostic

2024-09-17 Thread Marek Polacek
On Tue, Sep 17, 2024 at 05:16:48PM -0400, Jason Merrill wrote: > Tested x86_64-pc-linux-gnu. Marek, thoughts? Makes sense. OK, thanks. > -- 8< -- > > The -Wdangling-reference diagnostic talks about the full-expression, but > prints one call, while the full-expression in a declaration is the e

[PATCH 2/2] c++: -Wdangling-reference diagnostic

2024-09-17 Thread Jason Merrill
Tested x86_64-pc-linux-gnu. Marek, thoughts? -- 8< -- The -Wdangling-reference diagnostic talks about the full-expression, but prints one call, while the full-expression in a declaration is the entire initialization. It seems more useful to point out the temporary that the compiler thinks we mi