[clang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)
    Gábor Horváth via cfe-commits 
    cfe-commits at lists.llvm.org
       
    Sun Dec 31 22:21:18 PST 2023
    
    
  
================
@@ -52,10 +52,13 @@ class SimpleStreamChecker : public Checker<check::PostCall,
                                            check::PreCall,
                                            check::DeadSymbols,
                                            check::PointerEscape> {
-  CallDescription OpenFn, CloseFn;
+  const CallDescription OpenFn{{"fopen"}, 2};
+  const CallDescription CloseFn{{"fclose"}, 1};
----------------
Xazax-hun wrote:
Since we mostly use `CallDescription`s with compile time known inputs, it would be nice to make their ctors constexpr. This is not for this PR, just a note for the future.
https://github.com/llvm/llvm-project/pull/76655
    
    
More information about the cfe-commits
mailing list