Skip to content

requires-clauses think void values can be passed to variadic functions #135694

Open
@Alcaro

Description

@Alcaro
#include <type_traits>
void a(...);
template<typename T>
bool b()
{
    return requires { a(a(1)); };
}
bool c() { return b<void>(); }

Expected: Either false, because a(1) is void and cannot be passed to a(), or a hard error, because there is no set of template arguments for which that sub-expression is legal.

Actual: True.

https://godbolt.org/z/db83c35fq

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"conceptsC++20 conceptsconfirmedVerified by a second party

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions