Skip to content

std::enable_if mangling different in clang >= 18 compared to clang <= 17 or gcc #85656

Closed as not planned
@Romain-Geissler-1A

Description

@Romain-Geissler-1A

Hi,

While migrating to clang 18, we hit a name mangling difference compared to clang 17 (or gcc).

The following snippet:

#include <type_traits>

template <typename T> class SomeCondition
{
    public:
        static constexpr bool value = true;
};

template <typename T, typename std::enable_if<SomeCondition<T>::value, int>::type = 0> void SomeFunction(const T&);

void f()
{
    SomeFunction(0);
}

eventually leads to clang 18 mangle the call to SomeFunction as _Z12SomeFunctionIiTnNSt9enable_ifIXsr13SomeConditionIT_EE5valueEiE4typeELi0EEvRKS1_ (see Compiler explorer: https://godbolt.org/z/Khv93qxvf) while clang 17 does mangle it as _Z12SomeFunctionIiLi0EEvRKT_ (Compiler explorer: https://godbolt.org/z/WKeanb15P), and gcc as well (Compiler explorer: https://godbolt.org/z/1eqGKdnzY).

Is this change with clang 18 expected ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"invalidResolved as invalid, i.e. not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions