Re: [PATCH] c++: -Wdangling-reference with reference wrapper [PR107532]

2023-01-18 Thread Jason Merrill via Gcc-patches
On 1/18/23 12:52, Marek Polacek wrote: Here, -Wdangling-reference triggers where it probably shouldn't, causing some grief. The code in question uses a reference wrapper with a member function returning a reference to a subobject of a non-temporary object: const Plane & meta = fm.planes().in

[PATCH] c++: -Wdangling-reference with reference wrapper [PR107532]

2023-01-18 Thread Marek Polacek via Gcc-patches
Here, -Wdangling-reference triggers where it probably shouldn't, causing some grief. The code in question uses a reference wrapper with a member function returning a reference to a subobject of a non-temporary object: const Plane & meta = fm.planes().inner(); I've tried a few approaches, e.g.,