From 84d594c6487e4502beb72786cdd82c234b549a98 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Wed, 8 Feb 2012 04:52:11 -0500 Subject: [PATCH] =?utf8?q?re=20PR=20c++/52035=20(internal=20compiler=20err?= =?utf8?q?or:=20tree=20code=20=E2=80=98template=5Ftype=5Fparm=E2=80=99=20i?= =?utf8?q?s=20not=20supported=20in=20LTO=20streams)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit PR c++/52035 * pt.c (tsubst): Strip uninstantiated typedef. From-SVN: r184000 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 4 +++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/lto/README | 4 ++-- gcc/testsuite/g++.dg/lto/pr52035_0.C | 14 ++++++++++++++ 5 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/g++.dg/lto/pr52035_0.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6cc27423613..b506f4bd055 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2012-02-07 Jason Merrill + + PR c++/52035 + * pt.c (tsubst): Strip uninstantiated typedef. + 2012-02-06 Jason Merrill PR c++/52088 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 4c93b317432..a0b2a0b0907 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3fc813a4853..9f50b24ab3f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-02-07 Jason Merrill + + PR c++/52035 + * g++.dg/lto/pr52035_0.C: New. + 2012-02-07 John David Anglin * gfortran.dg/guality/pr41558.f90: Use lp64 instead of hppa*64*-*-*. diff --git a/gcc/testsuite/g++.dg/lto/README b/gcc/testsuite/g++.dg/lto/README index 5fa3123b42d..1a13dd92c62 100644 --- a/gcc/testsuite/g++.dg/lto/README +++ b/gcc/testsuite/g++.dg/lto/README @@ -24,9 +24,9 @@ $ g++ -o 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 index 00000000000..3de4ea57ba9 --- /dev/null +++ b/gcc/testsuite/g++.dg/lto/pr52035_0.C @@ -0,0 +1,14 @@ +// PR c++/52035 +// { dg-lto-do assemble } + +template struct QVector { + typedef T* iterator; + static void insert(int n); + typedef int size_type; +}; +template void QVector::insert(size_type n) {} +void error() +{ + int n; + QVector::insert(n); +} -- 2.30.2