[flang] [lld] [mlir] [llvm] [libcxx] [clang] [analyzer][NFC] Cleanup BugType lazy-init patterns (PR #76655)

Balazs Benics via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 1 09:50:47 PST 2024


================
@@ -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};
----------------
steakhal wrote:

Here is why we can't have CallDescriptions constexpr:
It's an owning type, holding a `std::vector<std::string>`, and they are themselves non-constexpr, until IDK cpp20+?
So, this is resolved.

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


More information about the cfe-commits mailing list