Index: lib/Tooling/ASTDiff/ASTDiff.cpp =================================================================== --- lib/Tooling/ASTDiff/ASTDiff.cpp +++ lib/Tooling/ASTDiff/ASTDiff.cpp @@ -384,8 +384,7 @@ // Strip the qualifier, if Val refers to somthing in the current scope. // But leave one leading ':' in place, so that we know that this is a // relative path. - if (!ContextPrefix.empty() && - StringRef(Val).startswith(ContextPrefix)) + if (!ContextPrefix.empty() && StringRef(Val).startswith(ContextPrefix)) Val = Val.substr(ContextPrefix.size() + 1); return Val; } @@ -715,6 +714,8 @@ if (auto *ND = ASTNode.get()) { if (ND->getDeclName().isIdentifier()) return ND->getQualifiedNameAsString(); + else + return std::string(); } return llvm::None; } @@ -723,6 +724,8 @@ if (auto *ND = ASTNode.get()) { if (ND->getDeclName().isIdentifier()) return ND->getName(); + else + return StringRef(); } return llvm::None; } Index: test/Tooling/clang-diff-heuristics.cpp =================================================================== --- test/Tooling/clang-diff-heuristics.cpp +++ test/Tooling/clang-diff-heuristics.cpp @@ -10,6 +10,8 @@ void f2(int) {;} +class C3 { C3(); }; + #else // same parents, same value @@ -22,4 +24,8 @@ // CHECK: Match CompoundStmt void f2() {} +// same parents, same identifier +// CHECK: Match CXXConstructorDecl: :C3(void ())(9) to CXXConstructorDecl: :C3(void (int))(6) +class C3 { C3(int); }; + #endif