diff options
author | Dodji Seketeli <dodji@redhat.com> | 2009-08-10 07:16:08 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2009-08-10 09:16:08 +0200 |
commit | b1d82db058de862ada748c903147c9676249ccb6 (patch) | |
tree | 312390e4e32b0a73b1c7dd7e92037b77a86af30b /gcc | |
parent | 5e3fef6ce6f71d750881dcaaacb4f7a6b1ab70d2 (diff) | |
download | gcc-b1d82db058de862ada748c903147c9676249ccb6.zip gcc-b1d82db058de862ada748c903147c9676249ccb6.tar.gz gcc-b1d82db058de862ada748c903147c9676249ccb6.tar.bz2 |
re PR c++/40866 (ICE in create_tmp_var, at gimplify.c:504)
2009-08-10 Dodji Seketeli <dodji@redhat.com>
gcc/ChangeLog:
PR c++/40866
* tree-inline.c (copy_statement_list): The resulting copy shouldn't
loose the original type of the statement list.
gcc/testsuite/ChangeLog:
PR c++/40866
* g++.dg/expr/stmt-expr-1.C: New test.
From-SVN: r150615
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/expr/stmt-expr-1.C | 36 | ||||
-rw-r--r-- | gcc/tree-inline.c | 1 |
4 files changed, 48 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c6c25de..026d176 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2009-08-10 Dodji Seketeli <dodji@redhat.com> + + PR c++/40866 + * tree-inline.c (copy_statement_list): The resulting copy shouldn't + loose the original type of the statement list. + 2009-08-09 Douglas B Rupp <rupp@gnat.com> * config/alpha/alpha.c: Include libfuncs.h diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a61a62c..0d67a05 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-08-10 Dodji Seketeli <dodji@redhat.com> + + PR c++/40866 + * g++.dg/expr/stmt-expr-1.C: New test. + 2009-08-09 Richard Guenther <rguenther@suse.de> PR tree-optimization/41016 diff --git a/gcc/testsuite/g++.dg/expr/stmt-expr-1.C b/gcc/testsuite/g++.dg/expr/stmt-expr-1.C new file mode 100644 index 0000000..2c50e35 --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/stmt-expr-1.C @@ -0,0 +1,36 @@ +// Contributed by Dodji Seketeli <dodji@redhat.com> +// Origin PR c++/40866 +// { dg-options "-std=gnu++98" } +// { dg-do "compile" } + +template <typename T> class QForeachContainer { +public: + QForeachContainer(); + int brk; + typename T::const_iterator i; +}; + +template <typename T> class QList { +public: + class const_iterator { + public: + const_iterator(const const_iterator &o); + const_iterator &operator++(); + }; +}; + +class QAction; +class QWidget { +public: + QList<QAction*> actions() const; +}; +class myDialog : public QWidget { + myDialog(); +}; + +myDialog::myDialog() +{ + QForeachContainer<__typeof__(actions())> _container_; + ({++_container_.brk; ++_container_.i;}); +} + diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c index f79ba75..3b07aaa 100644 --- a/gcc/tree-inline.c +++ b/gcc/tree-inline.c @@ -600,6 +600,7 @@ copy_statement_list (tree *tp) new_tree = alloc_stmt_list (); ni = tsi_start (new_tree); oi = tsi_start (*tp); + TREE_TYPE (new_tree) = TREE_TYPE (*tp); *tp = new_tree; for (; !tsi_end_p (oi); tsi_next (&oi)) |