This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++ PATCH for c++/50059


We were failing to print MODIFY_EXPR properly. I'm surprised that didn't turn up before now.

Tested x86_64-pc-linux-gnu, applied to trunk.
commit f8556f7a8d1bbf620edca19bd3d350ad7b82df7c
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Aug 13 03:01:09 2011 -0400

    	PR c++/50059
    	* error.c (dump_expr): Handle MODIFY_EXPR properly.

diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 3374488..48c0593 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -1868,6 +1868,10 @@ dump_expr (tree t, int flags)
 
     case INIT_EXPR:
     case MODIFY_EXPR:
+      dump_binary_op (assignment_operator_name_info[(int)NOP_EXPR].name,
+		      t, flags);
+      break;
+
     case PLUS_EXPR:
     case MINUS_EXPR:
     case MULT_EXPR:
diff --git a/gcc/testsuite/g++.dg/diagnostic/expr1.C b/gcc/testsuite/g++.dg/diagnostic/expr1.C
new file mode 100644
index 0000000..5651030
--- /dev/null
+++ b/gcc/testsuite/g++.dg/diagnostic/expr1.C
@@ -0,0 +1,9 @@
+// PR c++/50059
+
+int i;
+struct A { };
+void f(A);
+void g()
+{
+  f(i = 0);			// { dg-error "i = 0" }
+}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]