Diagnose friend function template redefinitions.
authorSerge Pavlov <sepavloff@gmail.com>
Thu, 6 Dec 2018 09:35:04 +0000 (09:35 +0000)
committerSerge Pavlov <sepavloff@gmail.com>
Thu, 6 Dec 2018 09:35:04 +0000 (09:35 +0000)
commitacfcd78aec83512807718605faf698a20af26fdd
treedca76f2f8b300d6c7760f4ee0035e56bbb84eacc
parent1027249ec908cb8ccac238953ee969bc7e6d40aa
Diagnose friend function template redefinitions.

Friend function template defined in a class template becomes available if
the enclosing class template is instantiated. Until the function template
is used, it does not have a body, but still is considered a definition for
the purpose of redeclaration checks.

This change modifies redefinition check so that it can find the friend
function template definitions in instantiated classes.

Differential Revision: http://reviews.llvm.org/D21508

llvm-svn: 348473
clang/include/clang/AST/DeclBase.h
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/test/Modules/friend-definition.cpp
clang/test/SemaCXX/friend-template-redecl.cpp
clang/test/SemaCXX/friend2.cpp