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

Clang crashes if the require clause lacks a comma #55401

Closed
ChuanqiXu9 opened this issue May 12, 2022 · 4 comments
Closed

Clang crashes if the require clause lacks a comma #55401

ChuanqiXu9 opened this issue May 12, 2022 · 4 comments
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" crash Prefer [crash-on-valid] or [crash-on-invalid] crash-on-invalid

Comments

@ChuanqiXu9
Copy link
Member

ChuanqiXu9 commented May 12, 2022

Here is the reproducer: https://godbolt.org/z/jd3av9rbP

template<class> concept f = requires { 42; };
struct h {
    int i = requires { { i } f }
};
@ChuanqiXu9 ChuanqiXu9 added c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" crash-on-invalid crash Prefer [crash-on-valid] or [crash-on-invalid] labels May 12, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented May 12, 2022

@llvm/issue-subscribers-c-20

@llvmbot
Copy link
Collaborator

llvmbot commented May 12, 2022

@llvm/issue-subscribers-clang-frontend

@tbaederr
Copy link
Contributor

This only reproduces with the -ferror-limit=1.

@ChuanqiXu9
Copy link
Member Author

This only reproduces with the -ferror-limit=1.

I'm looking at this. If you are interested, I would like to offload it : )

@gislan gislan closed this as completed in cab3cfd Jul 14, 2022
mem-frob pushed a commit to draperlaboratory/hope-llvm-project that referenced this issue Oct 7, 2022
The code would assume that SubstExpr() cannot fail on concept
specialization. This is incorret - we give up on some things after fatal
error occurred, since there's no value in doing futher work that the
user will not see anyway. In this case, this lead to crash.

The fatal error is simulated in tests with -ferror-limit=1, but this
could happen in other cases too.

Fixes llvm/llvm-project#55401

Differential Revision: https://reviews.llvm.org/D129499
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" crash Prefer [crash-on-valid] or [crash-on-invalid] crash-on-invalid
Projects
None yet
Development

No branches or pull requests

3 participants