-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Requires expression with local parameter of void type #109538
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
Comments
@llvm/issue-subscribers-clang-frontend Author: Fedor Chelnokov (Fedr)
This program is accepted by Clang (`requires` is evaluated as `true`):
```
static_assert( requires(void t) {t;} );
```
but rejected by GCC and MSVC with hard error: https://gcc.godbolt.org/z/W7f3zqbMb
If it were evaluated as |
Looks like a clang bug: https://godbolt.org/z/E7a4eEeKs I feel like we had another bug like this but can't find it. CC @erichkeane |
This seems to be an oversight in Like what we did in Further, we should set the RequiresExprBodyDecl to invalid in that event; we also want to set the satisfaction flag to false in |
Hi! This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below. |
@llvm/issue-subscribers-good-first-issue Author: Fedor Chelnokov (Fedr)
This program is accepted by Clang (`requires` is evaluated as `true`):
```
static_assert( requires(void t) {t;} );
```
but rejected by GCC and MSVC with hard error: https://gcc.godbolt.org/z/W7f3zqbMb
If it were evaluated as |
I would like to work on this issue. 💪 |
I've assigned it to you, have fun! Make sure you add a few of us (myself and @zyn0217 included!) to the review, and feel free to ask questions. |
…pression. (llvm#109831) Fixes llvm#109538. In this patch, we introduce diagnostic for required expression parameters in the same way as function parameters, fix the issue of handling void type parameters, and align the behavior with GCC and other compilers.
This program is accepted by Clang (
requires
is evaluated astrue
):but rejected by GCC and MSVC with hard error: https://gcc.godbolt.org/z/W7f3zqbMb
If it were evaluated as
false
, it would be more understandable.The text was updated successfully, but these errors were encountered: