https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124584
Yitang Yang <yi1tang.yang at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |yi1tang.yang at gmail dot com
--- Comment #7 from Yitang Yang <yi1tang.yang at gmail dot com> ---
Hello, not sure if this comes too late, but we ran into the same issue
and found that it can be triggered at `-O0` without `-fsanitize=address` as
well.
Diff against Vandeberg's reproducer:
```diff
41a42,50
> template <typename L> struct Expression_lhs {
> L lhs;
> explicit Expression_lhs(L &&in) : lhs(static_cast<L &&>(in)) {}
> };
>
> template <typename L> Expression_lhs<const L &> func(const L &operand) {
> return Expression_lhs<const L &>(operand);
> }
>
45c54
< (void)g;
---
> func(g);
```