From: Paolo Carlini <paolo.carlini@oracle.com>
To: Jason Merrill <jason@redhat.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [C++ Patch] PR 65370
Date: Tue, 10 Mar 2015 17:44:00 -0000 [thread overview]
Message-ID: <54FF2D62.7060503@oracle.com> (raw)
In-Reply-To: <54FF23F7.1010605@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 208 bytes --]
... in any case, I can confirm that the below also passes testing. Not
sure if it makes sense to add the check also to the other call site,
can't figure out a testcase...
Thanks,
Paolo.
/////////////////
[-- Attachment #2: patch_65370_2 --]
[-- Type: text/plain, Size: 978 bytes --]
Index: cp/decl.c
===================================================================
--- cp/decl.c (revision 221317)
+++ cp/decl.c (working copy)
@@ -1922,7 +1922,9 @@ duplicate_decls (tree newdecl, tree olddecl, bool
{
/* Per C++11 8.3.6/4, default arguments cannot be added in later
declarations of a function template. */
- check_redeclaration_no_default_args (newdecl);
+ if (DECL_SOURCE_LOCATION (newdecl)
+ != DECL_SOURCE_LOCATION (olddecl))
+ check_redeclaration_no_default_args (newdecl);
check_default_args (newdecl);
Index: testsuite/g++.dg/other/default11.C
===================================================================
--- testsuite/g++.dg/other/default11.C (revision 0)
+++ testsuite/g++.dg/other/default11.C (working copy)
@@ -0,0 +1,11 @@
+// PR c++/65370
+
+template <typename> class C
+{
+ template <typename U>
+ C(const C<U>&, bool = false);
+};
+
+template <>
+template <typename U>
+C<int>::C(const C<U>&, bool);
next prev parent reply other threads:[~2015-03-10 17:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-10 15:50 Paolo Carlini
2015-03-10 16:19 ` Jason Merrill
2015-03-10 17:03 ` Paolo Carlini
2015-03-10 17:44 ` Paolo Carlini [this message]
2015-03-10 18:10 ` Jason Merrill
2015-03-10 19:08 ` Paolo Carlini
2015-03-10 21:27 ` Jason Merrill
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54FF2D62.7060503@oracle.com \
--to=paolo.carlini@oracle.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).