diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-10 06:35:32 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-09-10 06:35:32 +0000 |
commit | 4576a77b809649f5b8d0ff8c7a4be57eeee0ecf9 (patch) | |
tree | 26b3a2987ae7f0dfcbf7e3c0d0e34ac246a547cb /clang/lib/Sema/SemaTemplate.cpp | |
parent | 4d10ba37b93755fa7a843e24b92f9bfc5b1b805d (diff) | |
download | bcm5719-llvm-4576a77b809649f5b8d0ff8c7a4be57eeee0ecf9.tar.gz bcm5719-llvm-4576a77b809649f5b8d0ff8c7a4be57eeee0ecf9.zip |
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
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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; |