]> granicus.if.org Git - clang/commit
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)
commite25870b80ed6717f2bf5cea1f9cd50ae0d9fcffb
tree94c1eabd38b0fec6f5c5b58535cb81118e2fe238
parente03e9db1ed1ed1ab0d798e61333e51119c2edf8b
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348473 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/DeclBase.h
lib/Sema/SemaDecl.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/Modules/friend-definition.cpp
test/SemaCXX/friend-template-redecl.cpp
test/SemaCXX/friend2.cpp