diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-22 22:25:03 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2016-08-22 22:25:03 +0000 |
commit | 2fbcbb7b38a770366a62dd5dba6c82267087ac65 (patch) | |
tree | 8db3b7dae3b81f3f87b934bf1285ebb88d449f6b /clang/test/Modules/Inputs/merge-template-pattern-visibility | |
parent | a72972b985e4553a8e607687bfb7e32bff25aa85 (diff) | |
download | bcm5719-llvm-2fbcbb7b38a770366a62dd5dba6c82267087ac65.tar.gz bcm5719-llvm-2fbcbb7b38a770366a62dd5dba6c82267087ac65.zip |
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.
llvm-svn: 279486
Diffstat (limited to 'clang/test/Modules/Inputs/merge-template-pattern-visibility')
-rw-r--r-- | clang/test/Modules/Inputs/merge-template-pattern-visibility/a.h | 1 | ||||
-rw-r--r-- | clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/clang/test/Modules/Inputs/merge-template-pattern-visibility/a.h b/clang/test/Modules/Inputs/merge-template-pattern-visibility/a.h index 7f9b6497e72..e6592027611 100644 --- a/clang/test/Modules/Inputs/merge-template-pattern-visibility/a.h +++ b/clang/test/Modules/Inputs/merge-template-pattern-visibility/a.h @@ -3,3 +3,4 @@ template<typename T> struct B; template<typename, typename> struct A {}; template<typename T> struct B : A<T> {}; +template<typename T> inline auto C(T) {} diff --git a/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h b/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h index 5ed18e7e7c5..6db3c2c6c9f 100644 --- a/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h +++ b/clang/test/Modules/Inputs/merge-template-pattern-visibility/b.h @@ -3,7 +3,9 @@ template<typename T> struct B; template<typename, typename> struct A {}; template<typename T> struct B : A<T> {}; +template<typename T> inline auto C(T) {} inline void f() { B<int> bi; + C(0); } |