diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index 5a04df04065a..d0f02ae95bc1 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -629,25 +629,9 @@ void StmtProfiler::VisitDecl(Decl *D) { } if (OverloadedFunctionDecl *Ovl = dyn_cast(D)) { - // Canonicalize all of the function declarations within the overload - // set. - llvm::SmallVector Functions; - for (OverloadedFunctionDecl::function_iterator F = Ovl->function_begin(), - FEnd = Ovl->function_end(); - F != FEnd; ++F) - Functions.push_back(F->get()->getCanonicalDecl()); - - // Sorting the functions based on the point means that the ID generated - // will be different from one execution of the compiler to another. - // Since these IDs don't persist over time, the change in ordering will - // not affect compilation. - std::sort(Functions.begin(), Functions.end()); - - for (llvm::SmallVector::iterator F = Functions.begin(), - FEnd = Functions.end(); - F != FEnd; ++F) - VisitDecl(*F); - + // The Itanium C++ ABI mangles references to a set of overloaded + // functions using just the function name, so we do the same here. + VisitName(Ovl->getDeclName()); return; } } diff --git a/clang/test/SemaTemplate/canonical-expr-type.cpp b/clang/test/SemaTemplate/canonical-expr-type.cpp index fec03c60764c..0580c677e627 100644 --- a/clang/test/SemaTemplate/canonical-expr-type.cpp +++ b/clang/test/SemaTemplate/canonical-expr-type.cpp @@ -22,12 +22,13 @@ void f0a(T x, __typeof__(f(N)) y) { } // expected-note{{previous}} void f(int); template -void f0a(T x, __typeof__(f(N)) y) { } // expected-error{{redefinition}} +void f0a(T x, __typeof__(f(N)) y) { } // expected-error{{redefinition}} \ + // expected-note{{previous}} void f(float); template -void f0a(T x, __typeof__(f(N)) y) { } +void f0a(T x, __typeof__(f(N)) y) { } // expected-error{{redefinition}} // Test dependently-sized array canonicalization template