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
This commit is contained in:
Jason Merrill 2009-11-08 17:27:39 -05:00 committed by Jason Merrill
parent f853515499
commit ecd0e97650
4 changed files with 37 additions and 4 deletions

View 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.

View 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),

View 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

View File

@ -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);
}