+2016-03-23 Patrick Palka <ppalka@gcc.gnu.org>
+
+ PR c++/70332
+ * pt.c (tsubst_copy) [PARM_DECL]: Handle the use of 'this' in an
+ NSDMI that's part of an aggregrate initialization.
+
2016-03-23 Jakub Jelinek <jakub@redhat.com>
PR c++/70001
if (r == NULL_TREE)
{
- /* We get here for a use of 'this' in an NSDMI. */
+ /* We get here for a use of 'this' in an NSDMI as part of a
+ constructor call or as part of an aggregate initialization. */
if (DECL_NAME (t) == this_identifier
- && current_function_decl
- && DECL_CONSTRUCTOR_P (current_function_decl))
+ && ((current_function_decl
+ && DECL_CONSTRUCTOR_P (current_function_decl))
+ || (current_class_ref
+ && TREE_CODE (current_class_ref) == PLACEHOLDER_EXPR)))
return current_class_ptr;
/* This can happen for a parameter name used later in a function