PATCH for Compiler internal error with gcc-2.8.1 and egcs-1.0.1
Mark Mitchell
mmitchell@usa.net
Tue Mar 10 16:56:00 GMT 1998
Jason --
How about this patch for code like this:
class c {
void (c::*x)();
public:
void f() { this->x(); }
};
--
Mark Mitchell mmitchell@usa.net
Stanford University http://www.stanford.edu
Tue Mar 10 16:58:00 1998 Mark Mitchell <mmitchell@usa.net>
* call.c (build_object_call): Don't crash if OBJ is a
pointer-to-member-function.
cvs server: Diffing .
Index: call.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/call.c,v
retrieving revision 1.48
diff -c -p -r1.48 call.c
*** call.c 1998/03/03 03:24:29 1.48
--- call.c 1998/03/11 00:54:20
*************** build_object_call (obj, args)
*** 2278,2283 ****
--- 2278,2291 ----
tree type = TREE_TYPE (obj);
tree templates = NULL_TREE;
+ if (TYPE_PTRMEMFUNC_P (type))
+ {
+ /* It's no good looking for an overloaded operator() on a
+ pointer-to-member-function. */
+ cp_error ("invalid use of pointer-to-member-function %E", obj);
+ return error_mark_node;
+ }
+
fns = lookup_fnfields (TYPE_BINFO (type), ansi_opname [CALL_EXPR], 0);
args = resolve_args (args);
cvs server: Diffing inc
More information about the Gcc-bugs
mailing list