https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105734
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #2)
> Reduced testcase:
> namespace hh {
> struct nothing {};
> template<typename A = int>
> struct expression_decomposer {
> auto h() {
> return expression_decomposer<bool>();
> }
> };
> }
>
> template <typename T>
> void bar() {
> auto m = hh::expression_decomposer( hh::expression_decomposer{}.h());
> m.~expression_decomposer();
> }
>
> void foo() { bar<int>(); }
The namespace is really required here. If I remove it, it works ...