================ ---------------- kazutakahirata wrote:
I cannot immediately think of common ways in which an iterator stays valid, but if you don't enable assertions or `LLVM_ENABLE_ABI_BREAKING_CHECKS`, you may be able to avoid a crash although that doesn't necessarily mean that clang-tidy is working correctly. If you would like a more reliable way to detect potential iterator invalidation, you could check the size of the data structure before and after calling `new FunctionParmMutationAnalyzer(...)`: ``` auto OldSize = Memorized.FuncParmAnalyzer.size(); NewValue = std::unique_ptr<FunctionParmMutationAnalyzer>( new FunctionParmMutationAnalyzer(Func, Context, Memorized)); auto NewSize = Memorized.FuncParmAnalyzer.size(); assert(OldSize == NewSize); it->second = NewValue; ``` https://github.com/llvm/llvm-project/pull/109145 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits