Re: [PATCH] c++: Fix -Weffc++ in templates [PR98841]

2021-01-28 Thread Jason Merrill via Gcc-patches
On 1/28/21 3:58 AM, Jakub Jelinek wrote: Hi! We emit a bogus warning on the following testcase, suggesting that the operator should return *this even when it does that already. The problem is that normally cp_build_indirect_ref_1 ensures that *this is folded as current_class_ref, but in

[PATCH] c++: Fix -Weffc++ in templates [PR98841]

2021-01-28 Thread Jakub Jelinek via Gcc-patches
Hi! We emit a bogus warning on the following testcase, suggesting that the operator should return *this even when it does that already. The problem is that normally cp_build_indirect_ref_1 ensures that *this is folded as current_class_ref, but in templates (if return type is non-dependent,