================
@@ -589,9 +589,10 @@ void FactsGenerator::handleUse(const DeclRefExpr *DRE) {
   OriginList *List = getOriginsList(*DRE);
   if (!List)
     return;
-  // Remove the outer layer of origin which borrows from the decl directly. 
This
-  // is a use of the underlying decl.
-  List = getRValueOrigins(DRE, List);
+  // Remove the outer layer of origin which borrows from the decl directly
+  // (e.g., when this is not a reference). This is a use of the underlying 
decl.
+  if (!DRE->getDecl()->getType()->isReferenceType())
----------------
Xazax-hun wrote:

This change looks good to me. The only surprising part, which strictly speaking 
is not related to this PR, I wonder if `getRValueOrigins` is at the right place 
to begin with. I'd expect this to show up in a code path that handles the 
lvalue to rvalue conversion. 

https://github.com/llvm/llvm-project/pull/176728
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to