+2018-03-06 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/84492
+ * semantics.c (finish_stmt_expr_expr): Reject unresolved
+ overloads used as stmt expr values.
+
2018-03-05 Jason Merrill <jason@redhat.com>
PR c++/84708 - ICE with lambda in local class NSDMI.
{
tree type = TREE_TYPE (expr);
- if (processing_template_decl)
+ if (type && type_unknown_p (type))
+ {
+ error ("a statement expression is an insufficient context"
+ " for overload resolution");
+ TREE_TYPE (stmt_expr) = error_mark_node;
+ return error_mark_node;
+ }
+ else if (processing_template_decl)
{
expr = build_stmt (input_location, EXPR_STMT, expr);
expr = add_stmt (expr);
+2018-03-06 Alexandre Oliva <aoliva@redhat.com>
+
+ PR c++/84492
+ * g++.dg/pr84492.C: New.
+
2018-03-05 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
* gcc.target/powerpc/spec-barr-1.c: Change called function name to
--- /dev/null
+// { dg-do compile }
+// { dg-options "-fpermissive" }
+
+template<int> int foo()
+{
+ return ({ foo; }); // { dg-error "insufficient context" }
+}
+
+int bar()
+{
+ return ({ foo; }); // { dg-error "insufficient context" }
+}
+
+void bar(int);
+
+typedef void (*bart)(int);
+
+bart barf()
+{
+ return ({ bar; }); // { dg-error "insufficient context" }
+}
+
+bool bark()
+{
+ return ({ barf; }); // ok, no overload
+}
+
+template <typename T>
+class C
+{
+ static int f();
+ bool g()
+ {
+ return ({ f; }); // ok, no overload
+ }
+ bool g(int)
+ {
+ return ({ g; }); // { dg-error "insufficient context" }
+ }
+};