Skip to content

[libc++] no_unique_address is reserved word in pre-C++20 dialects (non-conforming) #61196

Open
@JoeLoser

Description

@JoeLoser

As we can see on this Godbolt link, even when compiling in earlier dialects than C++20 (such as C++17), we get a compiler error since no_unique_address is effectively a reserved word even in pre-C++20 dialects.

Some context: Clang supports [[no_unique_address] in all dialects for C++11 and later (I don't know why it doesn't support it in C++03 mode, even as __attribute__((no_unique_address))).

Failing to support a double-underscored no_unique_address means that no_unique_address encroaches into the user's namespace in C++11 through C++17 dialects which is not good.

One resolution would be if Clang could start supporting a __dundered form of no_unique_address that would be safely usable by the implementor, e.g. __attribute__((__no_unique_address__)).

Metadata

Metadata

Assignees

No one assigned

    Labels

    libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions