-
Notifications
You must be signed in to change notification settings - Fork 12k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
volatile int is trivially copyable but not trivially relocatable
#77091
Labels
clang:frontend
Language frontend issues, e.g. anything involving "Sema"
Comments
|
@llvm/issue-subscribers-clang-frontend Author: Amirreza Ashouri (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.
|
AMP999
added a commit
to AMP999/llvm-project
that referenced
this issue
Jan 10, 2024
Consistent with `__is_trivially_copyable(volatile int) == true` and `__is_trivially_relocatable(volatile Trivial) == true`, `__is_trivially_relocatable(volatile int)` should also be `true`. Fixes llvm#77091 [clang] [test] New tests for __is_trivially_relocatable(cv-qualified type)
AMP999
added a commit
to AMP999/llvm-project
that referenced
this issue
Feb 12, 2024
Consistent with `__is_trivially_copyable(volatile int) == true` and `__is_trivially_relocatable(volatile Trivial) == true`, `__is_trivially_relocatable(volatile int)` should also be `true`. Fixes llvm#77091 [clang] [test] New tests for __is_trivially_relocatable(cv-qualified type)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://godbolt.org/z/4Y9z7sdEE
This Godbolt shows that clang considers
struct S { volatile int i; };"trivially relocatable", butvolatile intis considered "not-trivially relocatable". This is inconsistent. It's also inconsistent with the behavior ofstd::is_trivially_copyable_v<volatile int> == true.__is_trivially_relocatableshould do the same. Otherwise, we end up with a type that is trivially copyable but not trivially relocatable.The text was updated successfully, but these errors were encountered: