diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-30 22:13:51 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-30 22:13:51 +0000 |
commit | 4a5c15f75f76b95e1c2ceb6fa2737dcadd5f4be1 (patch) | |
tree | f32210da86a1180ad3a91260f5fa5201a1224252 /test/CXX | |
parent | 3307475eb0dd6e5d88be9392ea8247d0b6b812df (diff) |
Improve template argument deduction in the case where the parameter
type is a template-id (e.g., basic_ostream<CharT, Traits>) and the
argument type is a class that has a derived class matching the
parameter type. Previously, we were giving up on template argument
deduction too early.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83177 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CXX')
-rw-r--r-- | test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp index 596427adf9..dbe2ff3e18 100644 --- a/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp +++ b/test/CXX/temp/temp.fct.spec/temp.deduct/temp.deduct.call/p3.cpp @@ -66,6 +66,7 @@ template<typename T, int I> struct C { }; struct D : public C<int, 1> { }; struct E : public D { }; struct F : A<float> { }; +struct G : A<float>, C<int, 1> { }; template<typename T, int I> C<T, I> *f4a(const C<T, I>&); @@ -75,12 +76,13 @@ template<typename T, int I> C<T, I> *f4c(C<T, I>*); int *f4c(...); -void test_f4(D d, E e, F f) { +void test_f4(D d, E e, F f, G g) { C<int, 1> *ci1a = f4a(d); C<int, 1> *ci2a = f4a(e); C<int, 1> *ci1b = f4b(d); C<int, 1> *ci2b = f4b(e); C<int, 1> *ci1c = f4c(&d); C<int, 1> *ci2c = f4c(&e); + C<int, 1> *ci3c = f4c(&g); int *ip1 = f4c(&f); } |