[PATCH] D58634: [PR40778] Generate address space conversion when binding reference to a temporary value in different address space

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 28 08:02:33 PST 2021


Anastasia added inline comments.


================
Comment at: lib/Sema/SemaInit.cpp:4806-4808
+  if ((RefRelationship == Sema::Ref_Related &&
+       (T1CVRQuals | T2CVRQuals) != T1CVRQuals) ||
+      !T1Quals.isAddressSpaceSupersetOf(T2Quals)) {
----------------
ebevhan wrote:
> Sorry for the really late comment on this, but shouldn't this be:
> ```
>   if (RefRelationship == Sema::Ref_Related &&
>       ((T1CVRQuals | T2CVRQuals) != T1CVRQuals ||
>        !T1Quals.isAddressSpaceSupersetOf(T2Quals))) {
> ```
> 
> Currently, this fails on AS qualification regardless of ref-compatibility.
Sorry for noticing this late. I agree this doesn't look right... I will create a patch to fix this.


Repository:
  rC Clang

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

https://reviews.llvm.org/D58634



More information about the cfe-commits mailing list