C++ Logo

std-discussion

Advanced search

Re: Throwing noncopyable temporaries

From: Jens Maurer <Jens.Maurer_at_[hidden]>
Date: Fri, 2 Sep 2022 09:37:33 +0200
On 01/09/2022 13.55, Schneider, Robert via Std-Discussion wrote:
> Hi,
>
> GCC and clang at the moment allow throwing of noncopyable prvalue expressions:
>
> struct foo
> {
> foo() = default;
> foo(foo const&) = delete;
> foo(foo&&) = delete;
> };
>
> void bar()
> {
> throw foo();
> }
> https://compiler-explorer.com/z/d7h8f8ror

I've filed

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

for gcc and

https://github.com/llvm/llvm-project/issues/57519

for clang.

Jens

Received on 2022-09-02 07:37:37