Skip to content

Incorrect constraint check with template friend function #90349

Closed
@toddreed

Description

@toddreed

See https://godbolt.org/z/rTcabGbbh. This compiles with GCC 13.2, but with clang 18.1.0.

I’ve tried to reduce this to the smallest program that exhibits the bug, and AFAICT, it relates to a template friend function that has the same template arguments as its enclosing class, but the order of the template arguments are reversed. When instantiating the template function, the compiler seems to apply the wrong constraint checks (C++ concepts) on the template arguments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++20clang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions