Skip to content

Requires expression with local parameter of void type #109538

@Fedr

Description

@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 false, it would be more understandable.

Metadata

Metadata

Assignees

Labels

clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partydiverges-from:edgDoes the clang frontend diverge from edg compilerdiverges-from:gccDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issuegood first issuehttps://github.com/llvm/llvm-project/contribute

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions