Commit b80f8ef3 by Mark Mitchell Committed by Mark Mitchell

re PR c++/7129 (ICE with min/max assignment operators (<?= and >?=))


	PR c++/7129
	* call.c (z_candidate): Add args.
	(convert_class_to_reference): Set it.
	(implicit_conversion): Tidy.
	(add_candidate): Add args parameter.
	(add_function_candidate): Adjust call to add_candidate.
	(add_conv_candidate): Likewise.
	(build_builtin_candidate): Likewise.
	(build_user_type_conversion_1): Eliminate wasteful tree_cons
	usage.
	(build_new_function_call): Likewise.
	(build_object_call): Likewise.
	(add_candidates): New function.
	(build_new_op): Use it.
	(covert_like_real): Adjust call to build_over_call.
	(build_over_call): Remove args parameter.
	* operators.def: Add <?= and >?=.

	PR c++/7129
	* testsuite/g++.dg/ext/max.C: New test.

From-SVN: r62370
parent b3a8389d
2003-02-03 Mark Mitchell <mark@codesourcery.com>
PR c++/7129
* call.c (z_candidate): Add args.
(convert_class_to_reference): Set it.
(implicit_conversion): Tidy.
(add_candidate): Add args parameter.
(add_function_candidate): Adjust call to add_candidate.
(add_conv_candidate): Likewise.
(build_builtin_candidate): Likewise.
(build_user_type_conversion_1): Eliminate wasteful tree_cons
usage.
(build_new_function_call): Likewise.
(build_object_call): Likewise.
(add_candidates): New function.
(build_new_op): Use it.
(covert_like_real): Adjust call to build_over_call.
(build_over_call): Remove args parameter.
* operators.def: Add <?= and >?=.
2003-02-01 Richard Sandiford <rsandifo@redhat.com>
* typeck.c (build_indirect_ref): Don't check flag_volatile.
......
......@@ -5,7 +5,7 @@
non-overloadable operators (like the `?:' ternary operator).
Written by Mark Mitchell <mark@codesourcery.com>
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
......@@ -40,7 +40,7 @@ Boston, MA 02111-1307, USA. */
assignment operators, the same tree-codes are reused; i.e.,
`operator +' will also have PLUS_EXPR as its CODE.
NEW_MANGLING
MANGLING
The mangling prefix for the operator, as a C string, and as
mangled under the new ABI. For `operator +', for example, this
......@@ -127,7 +127,7 @@ DEF_SIMPLE_OPERATOR ("->", COMPONENT_REF, "pt", 2)
DEF_SIMPLE_OPERATOR ("[]", ARRAY_REF, "ix", 2)
DEF_SIMPLE_OPERATOR ("++", POSTINCREMENT_EXPR, "pp", 2)
DEF_SIMPLE_OPERATOR ("--", POSTDECREMENT_EXPR, "mm", 2)
/* These are extensions. */
/* These operators are GNU extensions. */
DEF_SIMPLE_OPERATOR ("<?", MIN_EXPR, "v23min", 2)
DEF_SIMPLE_OPERATOR (">?", MAX_EXPR, "v23max", 2)
/* This one is needed for mangling. */
......@@ -145,6 +145,9 @@ DEF_ASSN_OPERATOR ("|=", BIT_IOR_EXPR, "oR", 2)
DEF_ASSN_OPERATOR ("^=", BIT_XOR_EXPR, "eO", 2)
DEF_ASSN_OPERATOR ("<<=", LSHIFT_EXPR, "lS", 2)
DEF_ASSN_OPERATOR (">>=", RSHIFT_EXPR, "rS", 2)
/* These operators are GNU extensions. */
DEF_ASSN_OPERATOR ("<?=", MIN_EXPR, "v23miN", 2);
DEF_ASSN_OPERATOR (">?=", MAX_EXPR, "v23maX", 2);
/* Ternary operators. */
DEF_SIMPLE_OPERATOR ("?:", COND_EXPR, "qu", 3)
......
2003-02-03 Mark Mitchell <mark@codesourcery.com>
PR c++/7129
* testsuite/g++.dg/ext/max.C: New test.
Mon Feb 3 16:05:11 CET 2003 Jan Hubicka <jh@suse.cz>
* gcc.c-torture/execute/20030203-1.c: New test.
......
struct s_t {
};
void foo(void) {
s_t s; int i;
s<?=i; // { dg-error "" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment