https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101442

--- Comment #1 from Egor <iamsupermouse at mail dot ru> ---
Example is provided below. It prints `A()` and nothing else. I expected it to
also pring `~A()`.

```
#include <iostream>

struct A
{
    A() {std::cout << "A()\n";}
    A(const A &) = delete;
    A &operator=(const A &) = delete;
    ~A() {std::cout << "~A()\n";}
};

struct B
{
    const A &a;
    std::string s;
};

B foo()
{
    B ret{ A{}, "" };
    return ret;
}

int main()
{
    B b = foo();
}
```

Reply via email to