+2018-03-23 Marek Polacek <polacek@redhat.com>
+
+ PR c++/85045
+ * c-pretty-print.c (c_pretty_printer::multiplicative_expression)
+ <case RDIV_EXPR>: Tweak condition.
+
2018-03-20 Eric Botcazou <ebotcazou@adacore.com>
* c-ada-spec.c (pp_ada_tree_identifier): Deal specifically with _Bool.
pp_c_whitespace (this);
if (code == MULT_EXPR)
pp_c_star (this);
- else if (code == TRUNC_DIV_EXPR)
+ else if (code != TRUNC_MOD_EXPR)
pp_slash (this);
else
pp_modulo (this);
+2018-03-23 Marek Polacek <polacek@redhat.com>
+
+ PR c++/85045
+ * cxx-pretty-print.c (cxx_pretty_printer::multiplicative_expression):
+ Handle EXACT_DIV_EXPR and RDIV_EXPR. Tweak condition.
+ (cxx_pretty_printer::expression): Handle EXACT_DIV_EXPR and RDIV_EXPR.
+
2018-03-23 Ville Voutilainen <ville.voutilainen@gmail.com>
Implement P0962
case MULT_EXPR:
case TRUNC_DIV_EXPR:
case TRUNC_MOD_EXPR:
+ case EXACT_DIV_EXPR:
+ case RDIV_EXPR:
multiplicative_expression (TREE_OPERAND (e, 0));
pp_space (this);
if (code == MULT_EXPR)
pp_star (this);
- else if (code == TRUNC_DIV_EXPR)
+ else if (code != TRUNC_MOD_EXPR)
pp_slash (this);
else
pp_modulo (this);
case MULT_EXPR:
case TRUNC_DIV_EXPR:
case TRUNC_MOD_EXPR:
+ case EXACT_DIV_EXPR:
+ case RDIV_EXPR:
multiplicative_expression (t);
break;
PR c++/85033
* g++.dg/ext/builtin-offsetof2.C: New test.
+ PR c++/85045
+ * g++.dg/cpp0x/Wnarrowing5.C: New test.
+ * gcc.dg/pr85045.c: New test.
+
2018-03-23 Eric Botcazou <ebotcazou@adacore.com>
PR debug/85020
--- /dev/null
+// PR c++/85045
+// { dg-do compile { target c++11 } }
+
+typedef struct tt {
+ unsigned short h;
+} tt;
+
+void mainScreen(float a)
+{
+ tt numlrect = {int(100/a)}; // { dg-error "narrowing conversion" }
+}
--- /dev/null
+/* PR c/85045 */
+/* { dg-do compile } */
+/* { dg-options "-fno-diagnostics-show-caret" } */
+
+void
+f (double a, double b)
+{
+ (a / b) (); /* { dg-error "called object .a / b. is not a function or function pointer" } */
+}