]> gcc.gnu.org Git - gcc.git/commitdiff
re PR target/37290 (Endless recursion in cse_cc_succs)
authorJason Merrill <jason@redhat.com>
Sun, 8 Nov 2009 22:27:39 +0000 (17:27 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Sun, 8 Nov 2009 22:27:39 +0000 (17:27 -0500)
PR c++/37290
* pt.c (tsubst) [TYPEOF_TYPE]: Set cp_unevaluated_operand.

From-SVN: r154018

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

index 7dc15875cfe60169ef2929d6deb2b8872fd7dae3..6e94fe5326d68b32ecff6324361b187066c65370 100644 (file)
@@ -1,5 +1,8 @@
 2009-11-07  Jason Merrill  <jason@redhat.com>
 
+       PR c++/37290
+       * pt.c (tsubst) [TYPEOF_TYPE]: Set cp_unevaluated_operand.
+
        PR c++/18451
        PR c++/40738
        * cp-tree.h (cp_decl_specifier_seq): Add any_type_specifiers_p.
index dd453c526cc18a353b968dd7dcc582c8333853cf..6e708b3edfa9d9f9690656f8104583bb27e6cd81 100644 (file)
@@ -10220,10 +10220,17 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
       {
        tree type;
 
-       type = finish_typeof (tsubst_expr 
-                             (TYPEOF_TYPE_EXPR (t), args,
-                              complain, in_decl,
-                              /*integral_constant_expression_p=*/false));
+       ++cp_unevaluated_operand;
+       ++c_inhibit_evaluation_warnings;
+
+       type = tsubst_expr (TYPEOF_TYPE_EXPR (t), args,
+                           complain, in_decl,
+                           /*integral_constant_expression_p=*/false);
+
+       --cp_unevaluated_operand;
+       --c_inhibit_evaluation_warnings;
+
+       type = finish_typeof (type);
        return cp_build_qualified_type_real (type,
                                             cp_type_quals (t)
                                             | cp_type_quals (type),
index 550315a5a63588c6037609fad40114f99ee7a658..df46adb1129b17599c42798807ca2bf53990382a 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-07  Jason Merrill  <jason@redhat.com>
+
+       PR c++/37290
+       * g++.dg/ext/typeof11.C: New.
+
 2009-11-08  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/41985
diff --git a/gcc/testsuite/g++.dg/ext/typeof11.C b/gcc/testsuite/g++.dg/ext/typeof11.C
new file mode 100644 (file)
index 0000000..2e4e46c
--- /dev/null
@@ -0,0 +1,18 @@
+// PR c++/37290
+
+template<typename T> T& ensure_obj(const T&);
+template <typename T>
+void func2(T& t)
+{
+  typedef __typeof__(ensure_obj(t)) ttt;
+  struct ttt1
+  {
+    ttt1( ttt arg0 ){}
+  }  tttt ( t );
+}
+int main()
+{
+  double d = 5;
+  func2(d);
+}
+
This page took 0.103903 seconds and 5 git commands to generate.