BUGFIX for C++ in egcs-970828

Marcin Dalecki dalecki@sub994.sub.uni-goettingen.de
Tue Sep 2 03:16:00 GMT 1997


It speaks for itself:

diff -urN egcs-970828/gcc/cp/ChangeLog egcs-970828-fixed/gcc/cp/ChangeLog
--- egcs-970828/gcc/cp/ChangeLog	Sun Aug 31 17:37:44 1997
+++ egcs-970828-fixed/gcc/cp/ChangeLog	Tue Sep  2 03:12:36 1997
@@ -1,3 +1,17 @@
+Tue Sep  2 03:09:35 1997  Marcin Dalecki (dalecki@sub994.sub.uni-goettingen.de)
+
+    	* mathod.c (build_opfncall): Don't call build_new_op in case of 
+    	MODIFY_EXPR even in ansi overloading rules are specified. This fixes 
+    	the compilation of the follwing code snipplet:
+    	    struct {
+	      int bit1:7;
+	    } b;
+	    enum { val1 = 0x0f };
+	    void buddy (void)
+	    {
+	      b.bit1 |=  val1;
+	    }
+
 Wed Aug 27 02:03:34 1997  Jeffrey A Law  (law@cygnus.com)
 
 	* typeck.c (expand_target_expr): Make definition match declaration.
diff -urN egcs-970828/gcc/cp/method.c egcs-970828-fixed/gcc/cp/method.c
--- egcs-970828/gcc/cp/method.c	Mon Aug 25 17:33:21 1997
+++ egcs-970828-fixed/gcc/cp/method.c	Tue Sep  2 03:00:31 1997
@@ -1247,7 +1247,23 @@
   int try_second;
   int binary_is_unary;
 
-  if (flag_ansi_overloading)
+  /*
+   * Tue Sep  2 02:52:41 MET DST 1997 Marcin Dalecki:
+   * Since I don't understand the code here compleatly I was just trying
+   * to be as most nonintrusive as possible and just excluded the "code"
+   * value case, which will obviously handled wrongly for the following
+   * sample code:
+   * 
+   *       struct { int bit1:7;} b;
+   *       enum { val1 = 0x0f };
+   *       void buddy (void) { b.bit1 |=  val1; }
+   *
+   * Anybody who understand the new code in build_new_op() PLEASE FIX THIS
+   * error SOON, since it prevents QT-1.2 from beeing compiled correctly!
+   * Just a hint: The problem is that build_new_op doesn't get the cast
+   * from enum to int in case of this bitfield right.
+   */
+  if (flag_ansi_overloading && (code != MODIFY_EXPR))
     return build_new_op (code, flags, xarg1, xarg2, arg3);
 
   if (xarg1 == error_mark_node)


Since I'm not on this mailing list myself anymore please send all
replays/comments directly to me.

				Marcin
====================================================================
Langunages: Polish, German, English (in THAT order of precedence).
Homepage: http://sub994.sub.uni-goettingen.de
	  http://sub994.sub.uni-goettingen.de/polish.html




More information about the Gcc mailing list