This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 65370
- From: Jason Merrill <jason at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 10 Mar 2015 14:10:04 -0400
- Subject: Re: [C++ Patch] PR 65370
- Authentication-results: sourceware.org; auth=none
- References: <54FF12D4 dot 3060603 at oracle dot com> <54FF19A2 dot 2080501 at redhat dot com> <54FF23F7 dot 1010605 at oracle dot com>
On 03/10/2015 01:03 PM, Paolo Carlini wrote:
Good question, but we don't have this issue, because for that we emit
anyway:
65370.C:11:36: error: default argument specified in explicit
specialization [-fpermissive]
C<int>::C(const C<U>&, bool = false);
nothing changes about that kind of testcase, usual behavior.
Ah. So here we can ignore any template instantiation or specialization,
with a comment that check_explicit_specialization will handle them. But
I suspect that checking the decl itself will be better; I would expect
checking the context to lead you to accept
template<> class C<int> {
template <typename U>
C(const C<U>&, bool);
};
template <typename U> C<int>::C(const C<U>&, bool = false);
Since here C<int> is a specialization of C, but the constructor is not
itself a partial instantiation.
Jason