Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throwing a non-copyable exception #57519

Closed
jensmaurer opened this issue Sep 2, 2022 · 2 comments
Closed

Throwing a non-copyable exception #57519

jensmaurer opened this issue Sep 2, 2022 · 2 comments
Labels
accepts-invalid clang:frontend Language frontend issues, e.g. anything involving "Sema" duplicate Resolved as duplicate

Comments

@jensmaurer
Copy link

jensmaurer commented Sep 2, 2022

clang -std=c++20 accepts the following program:

struct S
{
  S() = default;
  S(const S&) = delete;
};

int main()
{
  try {
    throw S();         // #1
  } catch (S s) {
    return 1;
  }
}

but it is ill-formed at #1 according to [except.throw] p5. (We need to be able to copy exception objects in a type-erased manner for std::exception_ptr on implementations without reference-counted exceptions.)

Cross-reference: gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106812

@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" accepts-invalid and removed new issue labels Sep 2, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Sep 2, 2022

@llvm/issue-subscribers-clang-frontend

@CaseyCarter
Copy link
Member

This is a duplicate of #53224.

@EugeneZelenko EugeneZelenko added the duplicate Resolved as duplicate label Feb 6, 2023
@EugeneZelenko EugeneZelenko closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepts-invalid clang:frontend Language frontend issues, e.g. anything involving "Sema" duplicate Resolved as duplicate
Projects
None yet
Development

No branches or pull requests

4 participants