Skip to content

Mangling of Non-Type-Template-Parameter of type std::nullptr_t #206

@core-explorer

Description

@core-explorer

There are explicit rules for the mangling of the type std::nullptr_t = decltype(nullptr).
There are currently no rules for the mangling of values, e.g. in the mangling of

void foo<std::nullptr_t>() {}
template void foo<std::nullptr_t{}>() {}

GCC mangles this as _Z3fooILDnEEvv, i.e. because std::nullptr_t has only one value, specifying the type is enough to specifiy the value

clang mangles this as _Z3fooILDn0EEvv, i.e. nullptr has a value of zero.

Both of these seem valid, and very different from other types with only one valid value like std::monostate, which gets mangled as XtlSt9monostateEE, i.e. here is an expression that creates a std::monostate from an empty initializer list.

I think there needs to be clarification on how values of type std::nullptr_t should be mangled

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions