================
@@ -642,12 +642,16 @@ void FactsGenerator::VisitMaterializeTemporaryExpr(
   OriginList *RValMTEList = MTEList->peelOuterOrigin();
   flow(RValMTEList, SubExprList, /*Kill=*/true);
   OriginID OuterMTEID = MTEList->getOuterOriginID();
-  if (MTE->getStorageDuration() == SD_FullExpression) {
-    // Issue a loan to MTE for the storage location represented by MTE.
-    const Loan *L = createLoan(FactMgr, MTE);
-    CurrentBlockFacts.push_back(
-        FactMgr.createFact<IssueFact>(L->getID(), OuterMTEID));
-  }
+  const Loan *L = createLoan(FactMgr, MTE);
+  CurrentBlockFacts.push_back(
+      FactMgr.createFact<IssueFact>(L->getID(), OuterMTEID));
+  // A temporary extended to static or thread storage duration does not expire
+  // within the function.
+  // Thread termination is not modeled; a thread-local value used after its
+  // thread exits is not diagnosed.
+  if (MTE->getStorageDuration() == SD_Automatic)
----------------
ojhunt wrote:

yeah this is much clearer, thanks :)

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

Reply via email to