[clang] [clang] Emit -Wdangling diagnoses for cases where a gsl-pointer is construct from a gsl-owner object in a container. (PR #104556)

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 4 05:16:27 PDT 2024


================
@@ -344,9 +347,11 @@ static void handleGslAnnotatedTypes(IndirectLocalPath &Path, Expr *Call,
         break;
       }
     }
-    Path.push_back({Value ? IndirectLocalPathEntry::GslPointerInit
-                          : IndirectLocalPathEntry::GslReferenceInit,
-                    Arg, D});
+
+    Path.push_back({!ReturnType->isReferenceType()
+                        ? IndirectLocalPathEntry::GslPointerInit
+                        : IndirectLocalPathEntry::GslReferenceInit,
----------------
hokein wrote:

Done.

https://github.com/llvm/llvm-project/pull/104556


More information about the cfe-commits mailing list