================
@@ -237,13 +348,25 @@ void FactsGenerator::handleGSLPointerConstruction(const
CXXConstructExpr *CCE) {
assert(isGslPointerType(CCE->getType()));
if (CCE->getNumArgs() != 1)
return;
- if (hasOrigin(CCE->getArg(0)))
- killAndFlowOrigin(*CCE, *CCE->getArg(0));
- else
+
+ const Expr *Arg = CCE->getArg(0);
+ if (isGslPointerType(Arg->getType())) {
+ OriginList *ArgList = getOriginsList(*Arg);
+ assert(ArgList && "GSL pointer argument should have an origin list");
+ // GSL pointer is constructed from another gsl pointer.
+ // Example:
+ // View(View v);
+ // View(const View &v);
+ if (Arg->isGLValue())
----------------
usx95 wrote:
Hmm. This indeed looks like a pattern of forcing an `LValueToRValue` conversion.
https://github.com/llvm/llvm-project/pull/168344
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits