re PR c++/28288 (ICE with min/max operator)

PR c++/28288
	PR c++/14556
	* operators.def: Remove <?, ?>, <?=, and >?= operators.
	* parser.c: Remove CPP_MIN, CPP_MAX, CPP_MIN_EQ, and CPP_MAX_EQ.
	(cp_parser_warn_min_max): Remove.
	* include/cpplib.h: Remove <?, >?, <?=, and >?= tokens.
	(CPP_LAST_EQ): Change.
	(CPP_LAST_PUNCTUATOR): Change.
	* expr.c (cpp_operator): Remove MIN and MAX.
	(reduce): Remove CPP_MIN and CPP_MAX.
	(num_binary_op): Ditto.
	* lex.c (_cpp_lex_direct): Ditto.
	(cpp_avoid_paste): Remove ? as legal symbol after > or <.

From-SVN: r116140
This commit is contained in:
Steve Ellcey 2006-08-14 23:13:54 +00:00 committed by Steve Ellcey
parent ac1ed908de
commit b52dbbf865
7 changed files with 29 additions and 91 deletions

View file

@ -668,9 +668,6 @@ static const struct cpp_operator
/* RSHIFT */ {13, LEFT_ASSOC},
/* LSHIFT */ {13, LEFT_ASSOC},
/* MIN */ {10, LEFT_ASSOC | CHECK_PROMOTION},
/* MAX */ {10, LEFT_ASSOC | CHECK_PROMOTION},
/* COMPL */ {16, NO_L_OPERAND},
/* AND_AND */ {6, LEFT_ASSOC},
/* OR_OR */ {5, LEFT_ASSOC},
@ -882,8 +879,6 @@ reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op)
case CPP_MINUS:
case CPP_RSHIFT:
case CPP_LSHIFT:
case CPP_MIN:
case CPP_MAX:
case CPP_COMMA:
top[-1].value = num_binary_op (pfile, top[-1].value,
top->value, top->op);
@ -1309,7 +1304,6 @@ num_binary_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
{
cpp_num result;
size_t precision = CPP_OPTION (pfile, precision);
bool gte;
size_t n;
switch (op)
@ -1336,21 +1330,6 @@ num_binary_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
lhs = num_rshift (lhs, precision, n);
break;
/* Min / Max. */
case CPP_MIN:
case CPP_MAX:
{
bool unsignedp = lhs.unsignedp || rhs.unsignedp;
gte = num_greater_eq (lhs, rhs, precision);
if (op == CPP_MIN)
gte = !gte;
if (!gte)
lhs = rhs;
lhs.unsignedp = unsignedp;
}
break;
/* Arithmetic. */
case CPP_MINUS:
rhs = num_negate (rhs, precision);