diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2010-02-07 21:33:28 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2010-02-07 21:33:28 +0000 |
commit | a7ef13024e4cc3dfb75e3bc1695371b39d9a5240 (patch) | |
tree | ec5b9398833a85cfea9c68deea9a0f95844040b1 /test/SemaTemplate/deduction.cpp | |
parent | 1851a12605bc6f1ea70d11974a315340ebaab6eb (diff) | |
download | clang-a7ef13024e4cc3dfb75e3bc1695371b39d9a5240.tar.gz clang-a7ef13024e4cc3dfb75e3bc1695371b39d9a5240.tar.bz2 clang-a7ef13024e4cc3dfb75e3bc1695371b39d9a5240.tar.xz |
Require a complete type before examining base classes during template argument
deduction. This requires refactoring the deduction to have access to the Sema
object instead of merely the ASTContext. Still leaves something to be desired
due to poor source location.
Fixes PR6257 and half of PR6259.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95528 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaTemplate/deduction.cpp')
-rw-r--r-- | test/SemaTemplate/deduction.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/SemaTemplate/deduction.cpp b/test/SemaTemplate/deduction.cpp index 375d199f58..8d00bb796e 100644 --- a/test/SemaTemplate/deduction.cpp +++ b/test/SemaTemplate/deduction.cpp @@ -86,3 +86,15 @@ int array4[is_same<Replace<vector<int, _2>, double, float>::type, vector<int, fl template <typename T, int N> void f(const T (&a)[N]); int iarr[] = { 1 }; void test_PR5911() { f(iarr); } + +// Must not examine base classes of incomplete type during template argument +// deduction. +namespace PR6257 { + template <typename T> struct X { + template <typename U> X(const X<U>& u); + }; + struct A; + void f(A& a); + void f(const X<A>& a); + void test(A& a) { (void)f(a); } +} |