llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
29.32k stars 12.12k forks source link

Failure to compile void{} #51552

Open GabrielRavier opened 3 years ago

GabrielRavier commented 3 years ago
Bugzilla Link 52210
Version trunk
OS Linux
CC @DougGregor,@zygoloid,@xgupta

Extended Description

void f()
{
    void{};
}

This has been considered valid since http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2351 was accepted as a DR in 2018, but Clang fails to compile it, with this error:

<source>:3:9: error: illegal initializer type 'void'
    void{};
        ^
llvmbot commented 1 year ago

@llvm/issue-subscribers-clang-frontend

llvmbot commented 1 year ago

@llvm/issue-subscribers-c-20