This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13294] [3.4/3.5 Regression] namespace associations vs. specializations
- From: "jason at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Mar 2004 22:12:42 -0000
- Subject: [Bug c++/13294] [3.4/3.5 Regression] namespace associations vs. specializations
- References: <20031204043712.13294.bkoz@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jason at redhat dot com 2004-03-25 22:12 -------
Subject: PATCH Re: [3.4/3.5 Regression] namespace
associations vs. specializations
This patch seems to implement the desired behavior, which IIRC was to use
the specialization context for specializations of namespace-scope class
templates, but use the template context in all other cases. Testing now.
2004-03-25 Jason Merrill <jason@redhat.com>
PR c++/13294
* pt.c (maybe_process_partial_specialization): Remember the
context of a specialization.
*** pt.c.~1~ 2004-03-25 15:27:22.000000000 -0500
--- pt.c 2004-03-25 17:03:32.000000000 -0500
*************** maybe_process_partial_specialization (tr
*** 733,739 ****
{
tree tpl_ns = decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type));
if (is_associated_namespace (current_namespace, tpl_ns))
! /* Same or super-using namespace. */;
else
{
pedwarn ("specializing `%#T' in different namespace", type);
--- 733,747 ----
{
tree tpl_ns = decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type));
if (is_associated_namespace (current_namespace, tpl_ns))
! /* Same or super-using namespace. */
! {
! if (DECL_NAMESPACE_SCOPE_P (CLASSTYPE_TI_TEMPLATE (type)))
! /* If this is a specialization of a namespace-scope class
! template, remember the context of the
! specialization. */
! TYPE_CONTEXT (type) = DECL_CONTEXT (TYPE_NAME (type))
! = FROB_CONTEXT (current_namespace);
! }
else
{
pedwarn ("specializing `%#T' in different namespace", type);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13294