Anastasia accepted this revision.
Anastasia added a comment.
This revision is now accepted and ready to land.

LGTM! Yes it seems the only situation where the check would evaluate to a 
different value with and without your patch is when we have `RefRelationship == 
Sema::Ref_Related` as false while the address space is not a superset then we 
would get an incorrect diagnostic. But I feel this would be diagnosed elsewhere 
before we end up in this check.

FYI I was trying the following test case:

  void square(int num) {
    private int i = 0;
    private const float &ref = ++i;
  }

but it also fails with your patch which makes me feel there is a bug elsewhere 
too:

`error: reference of type 'const __private float &__private' cannot bind to a 
temporary object because of address space mismatch`

However I do believe that the fix makes sense because that particular check was 
intended for when `RefRelationship == Sema::Ref_Related` evaluates to true.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D103962

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D103962: [C++4Op... Anastasia Stulova via Phabricator via cfe-commits

Reply via email to