From 4576a77b809649f5b8d0ff8c7a4be57eeee0ecf9 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 10 Sep 2018 06:35:32 +0000 Subject: PR33222: Require the declared return type not the actual return type to match when checking for redeclaration of a function template. This properly handles differences in deduced return types, particularly when performing redeclaration checks for a friend function template. llvm-svn: 341778 --- clang/lib/Sema/SemaTemplate.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Sema/SemaTemplate.cpp') diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 45ce11874db..c826b836a70 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -8294,6 +8294,8 @@ Sema::CheckMemberSpecialization(NamedDecl *Member, LookupResult &Previous) { QualType Adjusted = Function->getType(); if (!hasExplicitCallingConv(Adjusted)) Adjusted = adjustCCAndNoReturn(Adjusted, Method->getType()); + // This doesn't handle deduced return types, but both function + // declarations should be undeduced at this point. if (Context.hasSameType(Adjusted, Method->getType())) { FoundInstantiation = *I; Instantiation = Method; -- cgit v1.2.3