]> granicus.if.org Git - clang/commit
Fix regression introduced by r279164: only pass definitions as the PatternDef
authorRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 22 Aug 2016 22:25:03 +0000 (22:25 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Mon, 22 Aug 2016 22:25:03 +0000 (22:25 +0000)
commite7c9a6c34ce335bd20aeb550763fa51e958f111f
treee5f9e5665b13e7e154cb6da951044f04ec97e7b6
parenta78fa9ec7a1a7cb5d2c62ef822e70ec7bbe415f4
Fix regression introduced by r279164: only pass definitions as the PatternDef
to DiagnoseUninstantiableTemplate, teach hasVisibleDefinition to correctly
determine whether a function definition is visible, and mark both the function
and the template as visible when merging function template definitions to
provide hasVisibleDefinition with the relevant information.

The change to always pass the right declaration as the PatternDef to
DiagnoseUninstantiableTemplate also caused those checks to happen before other
diagnostics in InstantiateFunctionDefinition, giving worse diagnostics for the
same situations, so I sunk the relevant diagnostics into
DiagnoseUninstantiableTemplate. Those parts of this patch are based on changes
in reviews.llvm.org/D23492 by Vassil Vassilev.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@279486 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaDecl.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
lib/Sema/SemaType.cpp
test/Modules/Inputs/merge-template-pattern-visibility/a.h
test/Modules/Inputs/merge-template-pattern-visibility/b.h
test/Modules/merge-template-pattern-visibility.cpp