PR c/79515
* c-warn.c (do_warn_double_promotion): Don't warn if an invalid
conversion has occured.
* gcc.dg/dfp/pr79515.c: New.
From-SVN: r245485
+2017-02-15 Marek Polacek <polacek@redhat.com>
+
+ PR c/79515
+ * c-warn.c (do_warn_double_promotion): Don't warn if an invalid
+ conversion has occured.
+
2017-01-24 David Malcolm <dmalcolm@redhat.com>
* c-common.c (c_common_reswords): Add "__RTL".
warn about it. */
if (c_inhibit_evaluation_warnings)
return;
+ /* If an invalid conversion has occured, don't warn. */
+ if (result_type == error_mark_node)
+ return;
if (TYPE_MAIN_VARIANT (result_type) != double_type_node
&& TYPE_MAIN_VARIANT (result_type) != complex_double_type_node)
return;
+2017-02-15 Marek Polacek <polacek@redhat.com>
+
+ PR c/79515
+ * gcc.dg/dfp/pr79515.c: New.
+
2017-02-15 David Edelsohn <dje.gcc@gmail.com>
* g++.dg/cpp0x/pr79296.C: Move dg-do compile directive first.
--- /dev/null
+/* PR c/79515 */
+/* { dg-do compile } */
+/* { dg-options "-Wdouble-promotion" } */
+
+extern _Decimal64 x;
+extern int i;
+
+void
+foo (void)
+{
+ if (x <= 2.0) /* { dg-error "mix operands" } */
+ i++;
+}