Skip to content

volatile int is trivially copyable but not trivially relocatable #77091

@AMP999

Description

@AMP999

https://godbolt.org/z/4Y9z7sdEE
This Godbolt shows that clang considers struct S { volatile int i; }; "trivially relocatable", but volatile int is considered "not-trivially relocatable". This is inconsistent. It's also inconsistent with the behavior of std::is_trivially_copyable_v<volatile int> == true. __is_trivially_relocatable should do the same. Otherwise, we end up with a type that is trivially copyable but not trivially relocatable.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions