+2010-06-04 Jakub Jelinek <jakub@redhat.com>
+ Jason Merrill <jason@redhat.com>
+
+ PR c++/44362
+ * call.c (build_conditional_expr): If both arg2 and arg3 are lvalues
+ with the same type, call mark_lvalue_use on both.
+
2010-06-03 Nathan Froyd <froydnj@codesourcery.com>
* class.c (struct vtbl_init_data_s): Remove last_init field.
&& same_type_p (arg2_type, arg3_type))
{
result_type = arg2_type;
+ mark_lvalue_use (arg2);
+ mark_lvalue_use (arg3);
goto valid_operands;
}
--- /dev/null
+/* PR c++/44362 */
+/* { dg-options "-Wunused" } */
+/* { dg-do compile } */
+
+int
+f1 (int u, int v)
+{
+ int a, b, c, d, e, f, g, h, i;
+ a = u;
+ b = v;
+ c = u;
+ d = v;
+ e = u;
+ f = v;
+ g = u == 6 ? a : b;
+ h = 0 ? c : d;
+ i = 1 ? e : f;
+ return g + h + i;
+}
+
+int
+f2 (int u, int v)
+{
+ int a, b, c, d, e, f, g, h, i;
+ a = u;
+ b = v;
+ c = u;
+ d = v;
+ e = u;
+ f = v;
+ g = u == 6 ? a + 1 : b;
+ h = 0 ? c + 1 : d;
+ i = 1 ? e + 1 : f;
+ return g + h + i;
+}
+
+int
+f3 (int u, int v)
+{
+ int a, b, c, d, e, f, g, h, i;
+ a = u;
+ b = v;
+ c = u;
+ d = v;
+ e = u;
+ f = v;
+ g = u == 6 ? a : b + 1;
+ h = 0 ? c : d + 1;
+ i = 1 ? e : f + 1;
+ return g + h + i;
+}
+
+int
+f4 (int u, int v)
+{
+ int a, c, e, g, h, i;
+ long b, d, f;
+ a = u;
+ b = v;
+ c = u;
+ d = v;
+ e = u;
+ f = v;
+ g = u == 6 ? a : b;
+ h = 0 ? c : d;
+ i = 1 ? e : f;
+ return g + h + i;
+}