Skip to content

__is_trivially_relocatable of non-object type is true #67498

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

Closed
JohelEGP opened this issue Sep 26, 2023 · 2 comments · Fixed by #69734
Closed

__is_trivially_relocatable of non-object type is true #67498

JohelEGP opened this issue Sep 26, 2023 · 2 comments · Fixed by #69734
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@JohelEGP
Copy link

JohelEGP commented Sep 26, 2023

See https://compiler-explorer.com/z/P9fYM9djj:

static_assert(!__is_trivially_copyable(int&));
static_assert(!__is_trivially_copyable(int()));
static_assert(__is_trivially_relocatable(int&));
static_assert(__is_trivially_relocatable(int()));
Compiler returned: 0

Here's a patch: Quuxplusone@8bd9e52.

@JohelEGP
Copy link
Author

The updated reproducer uses __is_trivially_copyable to illustrate the inconsistency.

@EugeneZelenko EugeneZelenko added clang:frontend Language frontend issues, e.g. anything involving "Sema" and removed new issue labels Sep 27, 2023
@llvmbot
Copy link
Member

llvmbot commented Sep 27, 2023

@llvm/issue-subscribers-clang-frontend

See <https://compiler-explorer.com/z/P9fYM9djj>: ```C++ static_assert(!__is_trivially_copyable(int&)); static_assert(!__is_trivially_copyable(int())); static_assert(__is_trivially_relocatable(int&)); static_assert(__is_trivially_relocatable(int())); ``` ```output Compiler returned: 0 ``` Here's a patch: <https://github.com/Quuxplusone/llvm-project/commit/8bd9e52829a155d1cf786458dc028d17d0545494>.

Quuxplusone added a commit to Quuxplusone/llvm-project that referenced this issue Oct 5, 2023
Both active C++ proposals (P1144 and P2786) agree that
`is_trivially_relocatable_v<int&>` and `is_trivially_relocatable_v<int()>`
should be false, not true. Only complete object types
can be trivially relocatable.

Fixes llvm#67498
Quuxplusone added a commit to Quuxplusone/llvm-project that referenced this issue Oct 15, 2023
Both active C++ proposals (P1144 and P2786) agree that
`is_trivially_relocatable_v<int&>` and `is_trivially_relocatable_v<int()>`
should be false, not true. Only complete object types
can be trivially relocatable.

Fixes llvm#67498
AMP999 added a commit to AMP999/llvm-project that referenced this issue Nov 28, 2023
Both active C++ proposals (P1144 and P2786) agree that
`is_trivially_relocatable_v<int&>` and `is_trivially_relocatable_v<int()>`
should be false, not true. Only complete object types
can be trivially relocatable.

Fixes llvm#67498
cor3ntin pushed a commit that referenced this issue Nov 28, 2023
Both active C++ proposals (P1144 and P2786) agree that
`is_trivially_relocatable_v<int&>` and
`is_trivially_relocatable_v<int()>` should be false, not true. Only
complete object types can be trivially relocatable.

Fixes #67498
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants