[clang] [Clang] Fix nonblocking warning for dependent default arguments (PR #235457)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 5 18:56:08 PST 2026


================
@@ -1342,6 +1342,14 @@ class Analyzer {
       return Result;
     }
 
+    bool TraverseParmVarDecl(ParmVarDecl *D) override {
+      // Uninstantiated default arguments are dependent expressions that cannot
+      // be analyzed for function effects without producing incorrect warnings.
----------------
ojhunt wrote:

This comment is wrong, as @ChenMiaoi said you're skipping the entire declaration, not just the default argument expression, but also this skips non-dependent default arguments as well.

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


More information about the cfe-commits mailing list