PR c++/85210
* pt.c (tsubst_decomp_names): Return error_mark_node and assert
errorcount is set if tsubst doesn't return a VAR_DECL.
* g++.dg/cpp1z/decomp42.C: New test.
From-SVN: r259181
+2018-04-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/85210
+ * pt.c (tsubst_decomp_names): Return error_mark_node and assert
+ errorcount is set if tsubst doesn't return a VAR_DECL.
+
2018-04-06 David Malcolm <dmalcolm@redhat.com>
PR c++/85021
DECL_HAS_VALUE_EXPR_P (decl2) = 1;
if (VAR_P (decl3))
DECL_TEMPLATE_INSTANTIATED (decl3) = 1;
+ else
+ {
+ gcc_assert (errorcount);
+ decl = error_mark_node;
+ continue;
+ }
maybe_push_decl (decl3);
if (error_operand_p (decl3))
decl = error_mark_node;
+2018-04-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/85210
+ * g++.dg/cpp1z/decomp42.C: New test.
+
2018-04-06 David Malcolm <dmalcolm@redhat.com>
PR c++/85021
--- /dev/null
+// PR c++/85210
+// { dg-do compile { target c++11 } }
+// { dg-options "" }
+
+struct A { int i; };
+
+template <int>
+void
+foo (int j)
+{
+ auto [j] = A{j}; // { dg-error "shadows a parameter" }
+} // { dg-warning "structured bindings only available with" "" { target c++14_down } .-1 }
+
+void
+bar ()
+{
+ foo<0> (0);
+}