Skip to content
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

__has_unique_object_representations doesn't seem to play nicely with templates #62019

Closed
cjdb opened this issue Apr 8, 2023 · 3 comments
Closed
Labels
accepts-invalid clang:frontend Language frontend issues, e.g. anything involving "Sema" rejects-valid

Comments

@cjdb
Copy link
Contributor

cjdb commented Apr 8, 2023

template<class T>
inline constexpr auto has_unique_object_representations = __has_unique_object_representations(T);

static_assert(not __has_unique_object_representations(_BitInt(7))); // passes, per clang/test/SemaCXX/has_unique_object_reps_bitint.cpp
static_assert(not has_unique_object_representations<_BitInt(7)>); // fails, yet is the same thing
$ clang --version
clang version 17.0.0 (https://github.com/llvm/llvm-project.git 39c0602414d4b0efb1e4749b0e9fdd7974026bf7)
Target: x86_64-unknown-linux-gnu
Thread model: posix

Compiler Explorer repro: https://godbolt.org/z/j6Pc484f5

@cjdb cjdb added clang:frontend Language frontend issues, e.g. anything involving "Sema" accepts-invalid rejects-valid labels Apr 8, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Apr 8, 2023

@llvm/issue-subscribers-clang-frontend

@shafik
Copy link
Collaborator

shafik commented Apr 9, 2023

I think this has something to do w/ BitInt if we use int or some other type it works ok: https://godbolt.org/z/4he3zs8jK

@royjacobson
Copy link
Contributor

gysit pushed a commit to nextsilicon/llvm-project that referenced this issue Apr 27, 2023
A bad QualType cast caused us not to detect _BigInt types if they were wrapped inside sugar types like SubstTemplateTypeParm.
Fix llvm#62019

Reviewed By: cjdb

Differential Revision: https://reviews.llvm.org/D147904
flemairen6 pushed a commit to Xilinx/llvm-project that referenced this issue May 10, 2023
A bad QualType cast caused us not to detect _BigInt types if they were wrapped inside sugar types like SubstTemplateTypeParm.
Fix llvm#62019

Reviewed By: cjdb

Differential Revision: https://reviews.llvm.org/D147904
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepts-invalid clang:frontend Language frontend issues, e.g. anything involving "Sema" rejects-valid
Projects
None yet
Development

No branches or pull requests

4 participants