This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ Patch] PR 65370
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Jason Merrill <jason at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 10 Mar 2015 18:03:51 +0100
- 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>
Hi,
On 03/10/2015 05:19 PM, Jason Merrill wrote:
On 03/10/2015 11:50 AM, Paolo Carlini wrote:
+ /* Don't get fooled by, eg:
+
+ template <typename> class C
+ {
+ template <typename U>
+ C(const C<U>&, bool = false);
+ };
+
+ template <>
+ template <typename U>
+ C<int>::C(const C<U>&, bool); */
+
+ if (DECL_FUNCTION_MEMBER_P (decl)
+ && CLASSTYPE_SPECIALIZATION_OF_PRIMARY_TEMPLATE_P
(DECL_CONTEXT (decl)))
+ return;
Wouldn't this also allow
template<>
template<typename U>
C<int>::C(const C<U>&, bool = false);
?
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.
Thanks,
Paolo.