[PATCH] D116203: [clang] adds unary type transformations as compiler built-ins

Christopher Di Bella via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Apr 3 21:59:27 PDT 2022


cjdb added a comment.

I've noticed that libstdc++ has `using __remove_cv = typename remove_cv<T>::type`, which causes Clang to chuck a wobbly. Changing from `KEYWORD` to `TYPE_TRAIT_1` didn't seem to fix anything.
Is there a way we can work around this, or should we just rename `__remove_cv` and friends to something else?



================
Comment at: clang/lib/Sema/SemaType.cpp:9227
 
-        DiagnoseUseOfDecl(ED, Loc);
+  QualType Underlying = Context.getIntTypeForBitwidth(
+      Context.getIntWidth(BaseType), IsMakeSigned);
----------------
rjmccall wrote:
> cjdb wrote:
> > erichkeane wrote:
> > > Can you add a couple of tests to make sure this works with _BitInt?  Note that this + the libc++ fixes get this done: https://github.com/llvm/llvm-project/issues/50427
> > Done for `_BitInt`. Is there a corresponding unsigned `_BitInt`? Neither `_BitUint`, `BitUInt`, nor `_UBitInt` work :(
> I believe `_BitInt` works like `int` et al., so it'd be `unsigned _BitInt`, 
All done, thanks!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116203/new/

https://reviews.llvm.org/D116203



More information about the cfe-commits mailing list