[clang] Enable -Wunique-object-duplication inside templated code (PR #125902)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 11 07:31:09 PST 2025


================
@@ -3669,6 +3669,7 @@ class Sema final : public SemaBase {
   /// cause problems if the variable is mutable, its initialization is
   /// effectful, or its address is taken.
   bool GloballyUniqueObjectMightBeAccidentallyDuplicated(const VarDecl *Dcl);
+  void DiagnoseDangerousUniqueObjectDuplication(const VarDecl *Dcl);
----------------
zmodem wrote:

Right, but (at least for me) it seems implied that a "diagnose" function would not emit any warnings for the harmless cases.

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


More information about the cfe-commits mailing list