Commit 91d8b4bd by Dodji Seketeli Committed by Dodji Seketeli

re PR c++/48574 (ICE)

Fix PR c++/48574

gcc/cp/

	* class.c (fixed_type_or_null): We cannot determine the dynamic
	type of a reference variable if its initializer is dependent.

gcc/testsuite/

	* g++.dg/template/dependent-expr7.C: New test case.

From-SVN: r172375
parent ba9c349e
2011-04-13 Dodji Seketeli <dodji@redhat.com>
PR c++/48574
* class.c (fixed_type_or_null): We cannot determine the dynamic
type of a reference variable if its initializer is dependent.
2011-04-13 Jason Merrill <jason@redhat.com>
PR c++/48581
......
......@@ -5939,6 +5939,7 @@ fixed_type_or_null (tree instance, int *nonnull, int *cdtorp)
itself. */
if (TREE_CODE (instance) == VAR_DECL
&& DECL_INITIAL (instance)
&& !type_dependent_expression_p (DECL_INITIAL (instance))
&& !htab_find (ht, instance))
{
tree type;
......
2011-04-13 Dodji Seketeli <dodji@redhat.com>
PR c++/48574
* g++.dg/template/dependent-expr7.C: New test case.
2011-04-13 Jason Merrill <jason@redhat.com>
* g++.dg/cpp0x/sfinae13.C: New.
......
// Origin PR c++/48574
// { dg-do compile }
struct A
{
virtual void foo();
};
template <typename T>
void
bar(T x)
{
A &b = *x;
b.foo ();
}
void
foo()
{
A a;
bar(&a);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment