Skip to content

[clang] Function SFINAE'd out but still leads to compiler error - compiles on GCC, EDG and MSVC #155189

@carlosgalvezp

Description

@carlosgalvezp

Hi!

Consider this example: https://godbolt.org/z/MTsq91oE3

The goal is for the foo and bar functions to be SFINAE'd out under the same condition. bar() and foo() are always enabled or disabled together. bar calls foo only when both bar and foo are enabled.

However Clang complains that bar() is calling the delete'd overload foo, which should not happen as per above. GCC, EDG and MSVC do not error and compile just fine.

So I wonder if this is a bug in Clang, or are GCC, EDG and MSVC being less restrictive?

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"diverges-from:edgDoes the clang frontend diverge from edg compiler on this issuediverges-from:gccDoes the clang frontend diverge from gcc on this issuediverges-from:msvcDoes the clang frontend diverge from msvc on this issuequestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!rejects-valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions