[Bug c++/28705] [4.0/4.1/4.2 Regression] ICE: in type_dependent_expression_p, at cp/pt.c:12837

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Sun Aug 13 00:26:00 GMT 2006

------- 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;

g/x> c++ -c x.cc
x.cc: In function 'void g()':
x.cc:10: internal compiler error: in type_dependent_expression_p, at
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.



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


More information about the Gcc-bugs mailing list