PR c++/86184
* tree.c (cp_save_expr): Don't call save_expr for TARGET_EXPRs.
* g++.dg/ext/cond3.C: New test.
From-SVN: r262254
+2018-06-29 Marek Polacek <polacek@redhat.com>
+
+ PR c++/86184
+ * tree.c (cp_save_expr): Don't call save_expr for TARGET_EXPRs.
+
2018-06-28 David Malcolm <dmalcolm@redhat.com>
* parser.c (cp_parser_error_1): After issuing a conflict marker
tree codes. */
if (processing_template_decl)
return expr;
+
+ /* TARGET_EXPRs are only expanded once. */
+ if (TREE_CODE (expr) == TARGET_EXPR)
+ return expr;
+
return save_expr (expr);
}
+2018-06-29 Marek Polacek <polacek@redhat.com>
+
+ PR c++/86184
+ * g++.dg/ext/cond3.C: New test.
+
2018-06-29 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* gcc.target/arm/arm-soft-strd-even.c: New test.
--- /dev/null
+// PR c++/86184
+// { dg-do run }
+// { dg-options "" }
+
+int j;
+struct X {
+ X() { j++; }
+ operator bool() { return true; }
+};
+
+/* Only create X once. */
+bool b = X() ?: false;
+bool b2 = X() ? X() : false;
+
+int
+main ()
+{
+ if (j != 3)
+ __builtin_abort ();
+}