OSDN Git Service

2009-08-10 Dodji Seketeli <dodji@redhat.com>
authordodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Aug 2009 07:16:08 +0000 (07:16 +0000)
committerdodji <dodji@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 10 Aug 2009 07:16:08 +0000 (07:16 +0000)
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150615 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/expr/stmt-expr-1.C [new file with mode: 0644]
gcc/tree-inline.c

index c6c25de..026d176 100644 (file)
@@ -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
index a61a62c..0d67a05 100644 (file)
@@ -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 (file)
index 0000000..2c50e35
--- /dev/null
@@ -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;});
+}
+
index f79ba75..3b07aaa 100644 (file)
@@ -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))