]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/52035 (internal compiler error: tree code ‘template_type_parm’ is not suppo...
authorJason Merrill <jason@redhat.com>
Wed, 8 Feb 2012 09:52:11 +0000 (04:52 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 8 Feb 2012 09:52:11 +0000 (04:52 -0500)
PR c++/52035
* pt.c (tsubst): Strip uninstantiated typedef.

From-SVN: r184000

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/lto/README
gcc/testsuite/g++.dg/lto/pr52035_0.C [new file with mode: 0644]

index 6cc274236136c368c1617042779129e072da7958..b506f4bd055657c5a33395ab2e08048d208e9fe5 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-07  Jason Merrill  <jason@redhat.com>
+
+       PR c++/52035
+       * pt.c (tsubst): Strip uninstantiated typedef.
+
 2012-02-06  Jason Merrill  <jason@redhat.com>
 
        PR c++/52088
index 4c93b317432e7314d8bafba4822ecb18f544b1e2..a0b2a0b0907f0411e13d7805d7581635c82605b4 100644 (file)
@@ -11178,7 +11178,9 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
             complain | tf_ignore_bad_quals);
          return r;
        }
-      /* Else we must be instantiating the typedef, so fall through.  */
+      else
+       /* We don't have an instantiation yet, so drop the typedef.  */
+       t = DECL_ORIGINAL_TYPE (decl);
     }
 
   if (type
index 3fc813a4853e7ac6502fa4ab36ef4874968b7395..9f50b24ab3f1f044913b90903ce373f25fe31b97 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-07  Jason Merrill  <jason@redhat.com>
+
+       PR c++/52035
+       * g++.dg/lto/pr52035_0.C: New.
+
 2012-02-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
 
        * gfortran.dg/guality/pr41558.f90: Use lp64 instead of hppa*64*-*-*.
index 5fa3123b42d04d22d1c87c12aeaab68e8092d399..1a13dd92c622fbbdfff870ffab20e330f981ee5b 100644 (file)
@@ -24,9 +24,9 @@ $ g++ -o <executable> a_0.o a_1.o a_2.o
 Tests that do not need more than one file are a special case
 where there is a single file named 'foo_0.C'.
 
-The only supported dg-lto-do option are 'compile', 'run' and 'link'.
+The only supported dg-lto-do option are 'assemble', 'run' and 'link'.
 Additionally, these can only be used in the main file.  If
-'compile' is used, only the individual object files are
+'assemble' is used, only the individual object files are
 generated.  If 'link' is used, the final executable is generated
 but not executed (in this case, function main() needs to exist
 but it does not need to do anything).  If 'run' is used, the
diff --git a/gcc/testsuite/g++.dg/lto/pr52035_0.C b/gcc/testsuite/g++.dg/lto/pr52035_0.C
new file mode 100644 (file)
index 0000000..3de4ea5
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/52035
+// { dg-lto-do assemble }
+
+template <typename T> struct QVector {
+    typedef T* iterator;
+    static void insert(int n);
+    typedef int size_type;
+};
+template <typename T> void QVector<T>::insert(size_type n) {}
+void error()
+{
+    int n;
+    QVector<int>::insert(n);
+}