This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++] Fix 19298


Hi,
this patch fixes a rejects-legal.  It's another place where we should
now be explicitly converting from reference, since I moved where that
should be occuring.

booted & tested on i686-pc-linux-gnu

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2005-01-07  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/19298
	* pt.c (tsubst_qualified_id): Call convert_from_reference.

Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.964
diff -c -3 -p -r1.964 pt.c
*** cp/pt.c	6 Jan 2005 15:22:05 -0000	1.964
--- cp/pt.c	7 Jan 2005 17:02:06 -0000
*************** tsubst_qualified_id (tree qualified_id, 
*** 7646,7651 ****
--- 7646,7653 ----
  	      (expr, scope, current_class_type));
        expr = finish_qualified_id_expr (scope, expr, done, address_p);
      }
+   
+   expr = convert_from_reference (expr);
  
    return expr;
  }
// Copyright (C) 2005 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 7 Jan 2005 <nathan@codesourcery.com>

// PR 19298: Rejects legal
// Origin: Andrew Pinski <pinskia@gcc.gnu.org>

struct t
{
  void f() const;
};

template <typename _Tp>
struct A
{
 static t const&  c;
};

template <typename _Tp>
void g(void)
{
  A<_Tp>::c.f();
}

void h(void)
{
  g<int>();
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]