diff --git a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp --- a/clang/lib/StaticAnalyzer/Core/CallEvent.cpp +++ b/clang/lib/StaticAnalyzer/Core/CallEvent.cpp @@ -328,9 +328,11 @@ if (const auto *II = Name.getAsIdentifierInfo()) return II == CD.II.getValue(); // Fast case. - // Simply report mismatch for: + // Fallback to the slow stringification and comparison for: // C++ overloaded operators, constructors, destructors, etc. - return false; + // FIXME This comparison is way SLOWER than comparing pointers. + // At some point in the future, we should compare FunctionDecl pointers. + return Name.getAsString() == CD.getFunctionName(); }; const auto ExactMatchArgAndParamCounts = diff --git a/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp b/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp --- a/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp +++ b/clang/unittests/StaticAnalyzer/CallDescriptionTest.cpp @@ -187,12 +187,11 @@ using namespace std; basic_string s("hello"); })code"; - // FIXME: We should match. const std::string Code = (Twine{MockStdStringHeader} + AdditionalCode).str(); EXPECT_TRUE(tooling::runToolOnCode( std::unique_ptr( new CallDescriptionAction({ - {{{"std", "basic_string", "basic_string"}, 2, 2}, false}, + {{{"std", "basic_string", "basic_string"}, 2, 2}, true}, })), Code)); } @@ -216,10 +215,9 @@ aaa::bbb::Bar x; int tmp = x; })code"; - // FIXME: We should match. EXPECT_TRUE(tooling::runToolOnCode( std::unique_ptr(new CallDescriptionAction<>({ - {{{"aaa", "bbb", "Bar", "operator int"}}, false}, + {{{"aaa", "bbb", "Bar", "operator int"}}, true}, })), Code)); }