diff options
author | Jason Merrill <jason@redhat.com> | 2009-11-08 17:27:39 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-11-08 17:27:39 -0500 |
commit | ecd0e976500873bd4dd728015d10896d4874a79f (patch) | |
tree | 418b051f38c46db8a328be6577978c04d4fd19a9 /gcc | |
parent | f853515499b0c584a88943918efaa4304baa4c83 (diff) | |
download | gcc-ecd0e976500873bd4dd728015d10896d4874a79f.zip gcc-ecd0e976500873bd4dd728015d10896d4874a79f.tar.gz gcc-ecd0e976500873bd4dd728015d10896d4874a79f.tar.bz2 |
re PR target/37290 (Endless recursion in cse_cc_succs)
PR c++/37290
* pt.c (tsubst) [TYPEOF_TYPE]: Set cp_unevaluated_operand.
From-SVN: r154018
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/pt.c | 15 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/typeof11.C | 18 |
4 files changed, 37 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7dc1587..6e94fe5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index dd453c5..6e708b3 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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), diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 550315a..df46adb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 index 0000000..2e4e46c --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/typeof11.C @@ -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); +} + |