diff options
author | Jason Merrill <jason@redhat.com> | 2016-11-04 08:47:01 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2016-11-04 08:47:01 -0400 |
commit | 866115cd8ac778b21557a13835f7942de6fca355 (patch) | |
tree | 7067d9dab2abb69ee8cf98ddda60a2e16feabcc8 /gcc | |
parent | 491483b026e0191a2683574d9bc2797bdd08207f (diff) | |
download | gcc-866115cd8ac778b21557a13835f7942de6fca355.zip gcc-866115cd8ac778b21557a13835f7942de6fca355.tar.gz gcc-866115cd8ac778b21557a13835f7942de6fca355.tar.bz2 |
PR c++/78198 - inherited template ctor with default arg
* call.c (convert_default_arg): Look through inheriting ctors.
From-SVN: r241843
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/call.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/inh-ctor22.C | 16 |
3 files changed, 24 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d20453b..544de43 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2016-11-03 Jason Merrill <jason@redhat.com> + + PR c++/78198 + * call.c (convert_default_arg): Look through inheriting ctors. + 2016-11-03 Jakub Jelinek <jakub@redhat.com> Alexandre Oliva <aoliva@redhat.com> Jason Merrill <jason@redhat.com> diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 27aa7fd..d2e99bc 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -7193,6 +7193,9 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum, /* See through clones. */ fn = DECL_ORIGIN (fn); + /* And inheriting ctors. */ + if (flag_new_inheriting_ctors) + fn = strip_inheriting_ctors (fn); /* Detect recursion. */ FOR_EACH_VEC_SAFE_ELT (default_arg_context, i, t) diff --git a/gcc/testsuite/g++.dg/cpp0x/inh-ctor22.C b/gcc/testsuite/g++.dg/cpp0x/inh-ctor22.C new file mode 100644 index 0000000..1b0e242 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/inh-ctor22.C @@ -0,0 +1,16 @@ +// { dg-do compile { target c++11 } } + +class A { }; +template<typename> using UniquePtr = int; +template<typename AllocPolicy> struct BufferList { + BufferList(unsigned, unsigned, unsigned, AllocPolicy = AllocPolicy()); +}; +class D : BufferList<A> { + using BufferList::BufferList; +}; +template<typename , typename... Args> UniquePtr<D> MakeUnique(Args... aArgs) +{ + D d(aArgs...); + return 0; +} +UniquePtr<D> setCloneBuffer_impl_buf = MakeUnique<D>(0, 0, 0); |