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
+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
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.
--- /dev/null
+// 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);
+}