PR c++/79822
* constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
({ (void) 0; }).
* g++.dg/cpp0x/constexpr-79822.C: New test.
From-SVN: r245925
+2017-03-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79822
+ * constexpr.c (cxx_eval_statement_list): Treat empty ({ }) like
+ ({ (void) 0; }).
+
2017-03-06 Jason Merrill <jason@redhat.com>
Revert "Allow deduction guides to look into primary template."
{
tree_stmt_iterator i;
tree local_target;
- /* In a statement-expression we want to return the last value. */
- tree r = NULL_TREE;
+ /* In a statement-expression we want to return the last value.
+ For empty statement expression return void_node. */
+ tree r = void_node;
if (!jump_target)
{
local_target = NULL_TREE;
+2017-03-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/79822
+ * g++.dg/cpp0x/constexpr-79822.C: New test.
+
2017-03-06 Richard Biener <rguenther@suse.de>
PR tree-optimization/79894
--- /dev/null
+// PR c++/79822
+// { dg-do compile }
+// { dg-options "" }
+
+bool
+foo ()
+{
+ bool a = ({ }) && false; // { dg-error "could not convert" }
+ bool b = ({ ; }) && false; // { dg-error "could not convert" }
+ bool c = ({ (void) 1; }) && false; // { dg-error "could not convert" }
+ return a && b && c;
+}