/* Call-backs for C++ error reporting.
This code is non-reentrant.
Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002,
- 2003, 2004, 2005 Free Software Foundation, Inc.
+ 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
This file is part of GCC.
GCC is free software; you can redistribute it and/or modify
pp_cxx_left_bracket (cxx_pp);
if (TYPE_DOMAIN (t))
{
- if (host_integerp (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0))
- pp_wide_integer
- (cxx_pp, tree_low_cst (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0) + 1);
- else if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (t))) == MINUS_EXPR)
- dump_expr (TREE_OPERAND (TYPE_MAX_VALUE (TYPE_DOMAIN (t)), 0),
+ tree dtype = TYPE_DOMAIN (t);
+ tree max = TYPE_MAX_VALUE (dtype);
+ if (host_integerp (max, 0))
+ pp_wide_integer (cxx_pp, tree_low_cst (max, 0) + 1);
+ else if (TREE_CODE (max) == MINUS_EXPR)
+ dump_expr (TREE_OPERAND (max, 0),
flags & ~TFF_EXPR_IN_PARENS);
else
- dump_expr (fold (cp_build_binary_op
- (PLUS_EXPR, TYPE_MAX_VALUE (TYPE_DOMAIN (t)),
- integer_one_node)),
+ dump_expr (fold_build2 (PLUS_EXPR, dtype, max,
+ build_int_cst (dtype, 1)),
flags & ~TFF_EXPR_IN_PARENS);
}
pp_cxx_right_bracket (cxx_pp);