re PR c++/48574 (ICE)
authorDodji Seketeli <dodji@redhat.com>
Mon, 9 May 2011 12:32:06 +0000 (12:32 +0000)
committerDodji Seketeli <dodji@gcc.gnu.org>
Mon, 9 May 2011 12:32:06 +0000 (14:32 +0200)
Fix PR c++/48574

gcc/cp/

PR c++/48574
* class.c (fixed_type_or_null): Use type_dependent_p_push to test
if the instance has a dependent initializer.

gcc/testsuite/

PR c++/48574
* g++.dg/template/dependent-expr8.C: New test case.

From-SVN: r173570

gcc/cp/ChangeLog
gcc/cp/class.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/dependent-expr8.C [new file with mode: 0644]

index be4d65aa7ac17d4351d8ce7418ccf329bdf030b0..9bd20b16b84730877cfa2ad87c64aa15ea70920e 100644 (file)
@@ -1,3 +1,9 @@
+2011-05-09  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/48574
+       * class.c (fixed_type_or_null): Use type_dependent_p_push to test
+       if the instance has a dependent initializer.
+
 2011-05-08  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/48816
index a67b34a7b60f6a41bf933cafa85aef43ce53b30d..6b08a038e0b59d2a48d8bce0bc1381c99a4307da 100644 (file)
@@ -5939,7 +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))
+             && !type_dependent_expression_p_push (DECL_INITIAL (instance))
              && !htab_find (ht, instance))
            {
              tree type;
index 735ac689dd3dcd4858ec8e31f311687d769c60dd..b15dba9b3500550dd4a6a4b846ed86dfc665357b 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-09  Dodji Seketeli  <dodji@redhat.com>
+
+       PR c++/48574
+       * g++.dg/template/dependent-expr8.C: New test case.
+
 2011-05-07  Zdenek Dvorak  <ook@ucw.cz>
 
        PR tree-optimization/48837
diff --git a/gcc/testsuite/g++.dg/template/dependent-expr8.C b/gcc/testsuite/g++.dg/template/dependent-expr8.C
new file mode 100644 (file)
index 0000000..20014d6
--- /dev/null
@@ -0,0 +1,25 @@
+// Origin PR c++/48574
+// { dg-options "-std=c++0x" }
+// { dg-do compile }
+
+struct A
+{
+  virtual int foo();
+};
+
+void baz (int);
+
+template <typename T>
+void
+bar(T x)
+{
+  A &b = *x;
+  baz (b.foo ());
+}
+
+void
+foo()
+{
+  A a;
+  bar(&a);
+}