------- Comment #2 from bangerth at dealii dot org  2006-08-13 00:26 -------
The code is invalid (because there is no constructor s::s(s*)), but
we can make the code valid and still ICE:

--------------------------
namespace N
{
  struct A { A(A*); };
  void foo(const A &);
}

template<typename T> void g()
{
  N::A *p;
  N::foo(A(p));
}
-----------------

g/x> c++ -c x.cc
x.cc: In function 'void g()':
x.cc:10: internal compiler error: in type_dependent_expression_p, at
cp/pt.c:12603
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.suse.de/feedback> for instructions.

The point of the exercise is that in the template, we have A(p); since
p is of type N::A*, we need to look up A in namespace A as well, so the
conversion constructor A(p) should be valid, should yield an object of
type N::A, which can be bound to the argument of N::foo.

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
           Keywords|                            |ice-on-valid-code
   Target Milestone|4.0.4                       |4.1.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28705

Reply via email to