{"id":807223,"url":"http://patchwork.ozlabs.org/api/patches/807223/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/CADzB+2mUjKGjCM-cg9gPdi2m+-UTw8zzZAaDqLQX90xm4KqC+Q@mail.gmail.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/projects/17/?format=json","name":"GNU Compiler Collection","link_name":"gcc","list_id":"gcc-patches.gcc.gnu.org","list_email":"gcc-patches@gcc.gnu.org","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<CADzB+2mUjKGjCM-cg9gPdi2m+-UTw8zzZAaDqLQX90xm4KqC+Q@mail.gmail.com>","list_archive_url":null,"date":"2017-08-29T18:43:41","name":"C++ PATCH to instantiate default args and default member inits once","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a4ee60cbf9be2f2bdeffbac589fc5079c3d9ec95","submitter":{"id":4337,"url":"http://patchwork.ozlabs.org/api/people/4337/?format=json","name":"Jason Merrill","email":"jason@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/CADzB+2mUjKGjCM-cg9gPdi2m+-UTw8zzZAaDqLQX90xm4KqC+Q@mail.gmail.com/mbox/","series":[{"id":434,"url":"http://patchwork.ozlabs.org/api/series/434/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=434","date":"2017-08-29T18:43:41","name":"C++ PATCH to instantiate default args and default member inits once","version":1,"mbox":"http://patchwork.ozlabs.org/series/434/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/807223/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/807223/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-return-461107-incoming=patchwork.ozlabs.org@gcc.gnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list gcc-patches@gcc.gnu.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-461107-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"nglitHr8\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xhcxM4lm1z9sP5\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 04:44:22 +1000 (AEST)","(qmail 4801 invoked by alias); 29 Aug 2017 18:44:15 -0000","(qmail 4790 invoked by uid 89); 29 Aug 2017 18:44:14 -0000","from mail-io0-f178.google.com (HELO mail-io0-f178.google.com)\n\t(209.85.223.178) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tTue, 29 Aug 2017 18:44:04 +0000","by mail-io0-f178.google.com with SMTP id s101so24584597ioe.0 for\n\t<gcc-patches@gcc.gnu.org>; Tue, 29 Aug 2017 11:44:04 -0700 (PDT)","by 10.107.181.23 with HTTP; Tue, 29 Aug 2017 11:43:41 -0700 (PDT)"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:mime-version:from:date:message-id:subject:to:content-type; q=\n\tdns; s=default; b=xZ433luGgjj1jWKllw2Bufp3fT945P33VImQB5f1NBSyt+\n\tfx01FCyoLlgptedbLPAZNox2kDqFg+JouQRpedy6YOY+51PDgfayBoYQrHTnnk9J\n\tgAvIWpgZB5YhprUSQsw3b6VbHZ8f6TWtULcYdlTIdVjo4auvtSlY9VMI3qTEo=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender\n\t:mime-version:from:date:message-id:subject:to:content-type; s=\n\tdefault; bh=ngUt2Al15v0ksjATRtcXQvyJbBA=; b=nglitHr8LL46tcHEtjGu\n\tLgniEajf3mmVvCzKKCSEbfbs7LcJf/QJde1r4Iw+6jBiHPtfhguozMiCup6Rx03X\n\tzFyHvzirg4y6jzAP63Spm3b/ysHBiKqs/OJ/fW7f3RatTuO2N5ZEO2QTWM7BBLIJ\n\tL1fpZ7wQKq0IuwYYKTjr2aQ=","Mailing-List":"contact gcc-patches-help@gcc.gnu.org; run by ezmlm","Precedence":"bulk","List-Id":"<gcc-patches.gcc.gnu.org>","List-Unsubscribe":"<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>","List-Archive":"<http://gcc.gnu.org/ml/gcc-patches/>","List-Post":"<mailto:gcc-patches@gcc.gnu.org>","List-Help":"<mailto:gcc-patches-help@gcc.gnu.org>","Sender":"gcc-patches-owner@gcc.gnu.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-24.1 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tKAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_SORBS_SPAM autolearn=ham version=3.3.2 spammy=charts,\n\ttraditionally","X-HELO":"mail-io0-f178.google.com","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net;\n\ts=20161025;\n\th=x-gm-message-state:mime-version:from:date:message-id:subject:to;\n\tbh=693A11sIcTIfeq67ioH6YspSFDHy7OgDSnitUBWS71Q=;\n\tb=kKFPbRZ2vklZA7MbhjPIXiPPlxJEOe1fLXz+fYmIhOrSE6NPXApN3jPjNnb4V1J5sw\n\tRJ4LW9jvS5AoK1f8BmKFWVTEPqDyek3VzXo4EePYWor6OERZ48qY5fLa+PZoqmBGHr43\n\tDJ157FU7wdynMiBZWWLPRS5oY1IPcsZTO1LKMSesmnebkjcmiH5SFNjVypQenBI2KJCK\n\t6buWbj7zz5dH30a06xiZDb0bJq6PaKDvrKmrgd2MWtUCFr+FZ7wU7uw1sjuRBH9iOd58\n\tNs5d6RgEZGdLIaBUcVpj25vDz9ZWuv6mSNsQS2bwrWvI15UEIN7U5c1gnDH/sRMFc6Pv\n\tTkeQ==","X-Gm-Message-State":"AHYfb5i4gGpANeGM/MmnJVGgfKuA2kitzmMha33S1azJnSYsgvM4fvLa\t17Tv/DhnjUh1uH+Q4qWXeVz2Z1LgCpV5MR8=","X-Received":"by 10.107.32.14 with SMTP id g14mr5147658iog.147.1504032242193;\n\tTue, 29 Aug 2017 11:44:02 -0700 (PDT)","MIME-Version":"1.0","From":"Jason Merrill <jason@redhat.com>","Date":"Tue, 29 Aug 2017 14:43:41 -0400","Message-ID":"<CADzB+2mUjKGjCM-cg9gPdi2m+-UTw8zzZAaDqLQX90xm4KqC+Q@mail.gmail.com>","Subject":"C++ PATCH to instantiate default args and default member inits once","To":"gcc-patches List <gcc-patches@gcc.gnu.org>","Content-Type":"multipart/mixed; boundary=\"001a1140c1d68736b50557e8cb35\"","X-IsSubscribed":"yes"},"content":"G++ has traditionally instantiated default arguments and default\nmember initializers wherever they are needed, but the standard\ndescribes default arguments as separate definitions, and the old way\nis problematic for the new lambda instantiation model.\n\nThis patch charts a middle course: now we will remember instantiations\nof default arguments/DMI, but if the instantiation fails in SFINAE\ncontext we can still fail substitution rather than give a hard error.\n\nTested x86_64-pc-linux-gnu, applying to trunk.\ncommit 68acac95b51e692c7ccd267aeebbc93e43e219d6\nAuthor: Jason Merrill <jason@redhat.com>\nDate:   Tue Aug 15 14:14:44 2017 -0700\n\n            Instantiate default arguments/member initializers once.\n    \n            * init.c (get_nsdmi): Remember NSDMI instantiations.\n            * parser.c (inject_this_parameter): Be more picky about\n            current_class_ptr.\n            * pt.c (tsubst_copy): Simplify 'this' handling.\n            (tsubst_default_argument): Remember default argument\n            instantiations.  Take parameter number.\n            (tsubst_default_arguments): Pass it.\n            * call.c (convert_default_arg): Likewise.","diff":"diff --git a/gcc/cp/call.c b/gcc/cp/call.c\nindex 6405be2..cfedd30 100644\n--- a/gcc/cp/call.c\n+++ b/gcc/cp/call.c\n@@ -7282,7 +7282,7 @@ convert_default_arg (tree type, tree arg, tree fn, int parmnum,\n   push_defarg_context (fn);\n \n   if (fn && DECL_TEMPLATE_INFO (fn))\n-    arg = tsubst_default_argument (fn, type, arg, complain);\n+    arg = tsubst_default_argument (fn, parmnum, type, arg, complain);\n \n   /* Due to:\n \ndiff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h\nindex f2e54a8..f0eafb3 100644\n--- a/gcc/cp/cp-tree.h\n+++ b/gcc/cp/cp-tree.h\n@@ -6465,7 +6465,7 @@ extern tree maybe_process_partial_specialization (tree);\n extern tree most_specialized_instantiation\t(tree);\n extern void print_candidates\t\t\t(tree);\n extern void instantiate_pending_templates\t(int);\n-extern tree tsubst_default_argument\t\t(tree, tree, tree,\n+extern tree tsubst_default_argument\t\t(tree, int, tree, tree,\n \t\t\t\t\t\t tsubst_flags_t);\n extern tree tsubst (tree, tree, tsubst_flags_t, tree);\n extern tree tsubst_copy_and_build\t\t(tree, tree, tsubst_flags_t,\ndiff --git a/gcc/cp/init.c b/gcc/cp/init.c\nindex 83e685c..56a5df8 100644\n--- a/gcc/cp/init.c\n+++ b/gcc/cp/init.c\n@@ -535,6 +535,8 @@ perform_target_ctor (tree init)\n \n /* Return the non-static data initializer for FIELD_DECL MEMBER.  */\n \n+static GTY(()) hash_map<tree, tree> *nsdmi_inst;\n+\n tree\n get_nsdmi (tree member, bool in_ctor, tsubst_flags_t complain)\n {\n@@ -542,31 +544,36 @@ get_nsdmi (tree member, bool in_ctor, tsubst_flags_t complain)\n   tree save_ccp = current_class_ptr;\n   tree save_ccr = current_class_ref;\n   \n-  if (!in_ctor)\n-    {\n-      /* Use a PLACEHOLDER_EXPR when we don't have a 'this' parameter to\n-\t refer to; constexpr evaluation knows what to do with it.  */\n-      current_class_ref = build0 (PLACEHOLDER_EXPR, DECL_CONTEXT (member));\n-      current_class_ptr = build_address (current_class_ref);\n-    }\n-\n   if (DECL_LANG_SPECIFIC (member) && DECL_TEMPLATE_INFO (member))\n     {\n       init = DECL_INITIAL (DECL_TI_TEMPLATE (member));\n+      location_t expr_loc\n+\t= EXPR_LOC_OR_LOC (init, DECL_SOURCE_LOCATION (member));\n+      tree *slot;\n       if (TREE_CODE (init) == DEFAULT_ARG)\n \t/* Unparsed.  */;\n+      else if (nsdmi_inst && (slot = nsdmi_inst->get (member)))\n+\tinit = *slot;\n       /* Check recursive instantiation.  */\n       else if (DECL_INSTANTIATING_NSDMI_P (member))\n \t{\n \t  if (complain & tf_error)\n-\t    error (\"recursive instantiation of default member \"\n-\t\t   \"initializer for %qD\", member);\n+\t    error_at (expr_loc, \"recursive instantiation of default member \"\n+\t\t      \"initializer for %qD\", member);\n \t  init = error_mark_node;\n \t}\n       else\n \t{\n+\t  int un = cp_unevaluated_operand;\n+\t  cp_unevaluated_operand = 0;\n+\n+\t  location_t sloc = input_location;\n+\t  input_location = expr_loc;\n+\n \t  DECL_INSTANTIATING_NSDMI_P (member) = 1;\n \n+\t  inject_this_parameter (DECL_CONTEXT (member), TYPE_UNQUALIFIED);\n+\n \t  /* Do deferred instantiation of the NSDMI.  */\n \t  init = (tsubst_copy_and_build\n \t\t  (init, DECL_TI_ARGS (member),\n@@ -575,6 +582,16 @@ get_nsdmi (tree member, bool in_ctor, tsubst_flags_t complain)\n \t  init = digest_nsdmi_init (member, init, complain);\n \t  \n \t  DECL_INSTANTIATING_NSDMI_P (member) = 0;\n+\n+\t  if (init != error_mark_node)\n+\t    {\n+\t      if (!nsdmi_inst)\n+\t\tnsdmi_inst = hash_map<tree,tree>::create_ggc (37);\n+\t      nsdmi_inst->put (member, init);\n+\t    }\n+\n+\t  input_location = sloc;\n+\t  cp_unevaluated_operand = un;\n \t}\n     }\n   else\n@@ -592,6 +609,19 @@ get_nsdmi (tree member, bool in_ctor, tsubst_flags_t complain)\n       init = error_mark_node;\n     }\n \n+  if (in_ctor)\n+    {\n+      current_class_ptr = save_ccp;\n+      current_class_ref = save_ccr;\n+    }\n+  else\n+    {\n+      /* Use a PLACEHOLDER_EXPR when we don't have a 'this' parameter to\n+\t refer to; constexpr evaluation knows what to do with it.  */\n+      current_class_ref = build0 (PLACEHOLDER_EXPR, DECL_CONTEXT (member));\n+      current_class_ptr = build_address (current_class_ref);\n+    }\n+\n   /* Strip redundant TARGET_EXPR so we don't need to remap it, and\n      so the aggregate init code below will see a CONSTRUCTOR.  */\n   bool simple_target = (init && SIMPLE_TARGET_EXPR_P (init));\ndiff --git a/gcc/cp/parser.c b/gcc/cp/parser.c\nindex 9b7c2c0..d66f146 100644\n--- a/gcc/cp/parser.c\n+++ b/gcc/cp/parser.c\n@@ -20715,7 +20715,9 @@ inject_this_parameter (tree ctype, cp_cv_quals quals)\n     {\n       /* We don't clear this between NSDMIs.  Is it already what we want?  */\n       tree type = TREE_TYPE (TREE_TYPE (current_class_ptr));\n-      if (same_type_ignoring_top_level_qualifiers_p (ctype, type)\n+      if (DECL_P (current_class_ptr)\n+\t  && DECL_CONTEXT (current_class_ptr) == NULL_TREE\n+\t  && same_type_ignoring_top_level_qualifiers_p (ctype, type)\n \t  && cp_type_quals (type) == quals)\n \treturn;\n     }\ndiff --git a/gcc/cp/pt.c b/gcc/cp/pt.c\nindex d5d6dd0..847cd68 100644\n--- a/gcc/cp/pt.c\n+++ b/gcc/cp/pt.c\n@@ -12001,11 +12001,14 @@ tsubst_aggr_type (tree t,\n     }\n }\n \n+static GTY(()) hash_map<tree, tree> *defarg_inst;\n+\n /* Substitute into the default argument ARG (a default argument for\n    FN), which has the indicated TYPE.  */\n \n tree\n-tsubst_default_argument (tree fn, tree type, tree arg, tsubst_flags_t complain)\n+tsubst_default_argument (tree fn, int parmnum, tree type, tree arg,\n+\t\t\t tsubst_flags_t complain)\n {\n   tree saved_class_ptr = NULL_TREE;\n   tree saved_class_ref = NULL_TREE;\n@@ -12015,6 +12018,17 @@ tsubst_default_argument (tree fn, tree type, tree arg, tsubst_flags_t complain)\n   if (TREE_CODE (arg) == DEFAULT_ARG)\n     return arg;\n \n+  tree parm = FUNCTION_FIRST_USER_PARM (fn);\n+  parm = chain_index (parmnum, parm);\n+  tree parmtype = TREE_TYPE (parm);\n+  if (DECL_BY_REFERENCE (parm))\n+    parmtype = TREE_TYPE (parmtype);\n+  gcc_assert (same_type_ignoring_top_level_qualifiers_p (type, parmtype));\n+\n+  tree *slot;\n+  if (defarg_inst && (slot = defarg_inst->get (parm)))\n+    return *slot;\n+\n   /* This default argument came from a template.  Instantiate the\n      default argument here, not in tsubst.  In the case of\n      something like:\n@@ -12067,6 +12081,13 @@ tsubst_default_argument (tree fn, tree type, tree arg, tsubst_flags_t complain)\n \n   pop_access_scope (fn);\n \n+  if (arg != error_mark_node && !cp_unevaluated_operand)\n+    {\n+      if (!defarg_inst)\n+\tdefarg_inst = hash_map<tree,tree>::create_ggc (37);\n+      defarg_inst->put (parm, arg);\n+    }\n+\n   return arg;\n }\n \n@@ -12088,11 +12109,12 @@ tsubst_default_arguments (tree fn, tsubst_flags_t complain)\n   if (DECL_CLONED_FUNCTION_P (fn))\n     return;\n \n+  int i = 0;\n   for (arg = TYPE_ARG_TYPES (TREE_TYPE (fn));\n        arg;\n-       arg = TREE_CHAIN (arg))\n+       arg = TREE_CHAIN (arg), ++i)\n     if (TREE_PURPOSE (arg))\n-      TREE_PURPOSE (arg) = tsubst_default_argument (fn,\n+      TREE_PURPOSE (arg) = tsubst_default_argument (fn, i,\n \t\t\t\t\t\t    TREE_VALUE (arg),\n \t\t\t\t\t\t    TREE_PURPOSE (arg),\n \t\t\t\t\t\t    complain);\n@@ -14500,13 +14522,8 @@ tsubst_copy (tree t, tree args, tsubst_flags_t complain, tree in_decl)\n \n       if (r == NULL_TREE)\n \t{\n-\t  /* We get here for a use of 'this' in an NSDMI as part of a\n-\t     constructor call or as part of an aggregate initialization.  */\n-\t  if (DECL_NAME (t) == this_identifier\n-\t      && ((current_function_decl\n-\t\t   && DECL_CONSTRUCTOR_P (current_function_decl))\n-\t\t  || (current_class_ref\n-\t\t      && TREE_CODE (current_class_ref) == PLACEHOLDER_EXPR)))\n+\t  /* We get here for a use of 'this' in an NSDMI.  */\n+\t  if (DECL_NAME (t) == this_identifier && current_class_ptr)\n \t    return current_class_ptr;\n \n \t  /* This can happen for a parameter name used later in a function\ndiff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-62155.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-62155.C\nindex 76eb2da..3d1c113 100644\n--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-62155.C\n+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-62155.C\n@@ -1,8 +1,8 @@\n // PR c++/62155\n // { dg-do compile { target c++11 } } \n \n-template <typename T> struct S { // { dg-error \"cannot convert\" }\n-  T i{[this] {}};\n+template <typename T> struct S {\n+  T i{[this] {}};\t\t// { dg-error \"cannot convert\" }\n };\n \n-S<int> s;                        // { dg-error \"cannot convert\" }\n+S<int> s;\t\t\t// { dg-message \"required\" }\ndiff --git a/gcc/testsuite/g++.dg/cpp1z/direct-enum-init1.C b/gcc/testsuite/g++.dg/cpp1z/direct-enum-init1.C\nindex b473ed5..ee39ab4 100644\n--- a/gcc/testsuite/g++.dg/cpp1z/direct-enum-init1.C\n+++ b/gcc/testsuite/g++.dg/cpp1z/direct-enum-init1.C\n@@ -140,11 +140,11 @@ struct U2\n template <int N>\n struct W2\n {\n-  A a { 5 };\t\t// { dg-error \"invalid conversion from 'int' to 'A'\" \"\" { target *-*-* } .-2 }\n-  B b { 6 };\t\t// { dg-error \"invalid conversion from 'int' to 'B'\" \"\" { target c++14_down } .-3 }\n-  C c { 3.0f };\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'C' in initialization\" \"\" { target c++14_down } .-4 }\n-\t\t\t// { dg-error \"narrowing conversion of '3.0e.0f' from 'float' to 'int' inside\" \"\" { target c++1z } .-5 }\n-  D d = { 7 };\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'D' in initialization\" \"\" { target *-*-* } .-6 }\n+  A a { 5 };\t\t// { dg-error \"invalid conversion from 'int' to 'A'\" \"\" { target *-*-* } }\n+  B b { 6 };\t\t// { dg-error \"invalid conversion from 'int' to 'B'\" \"\" { target c++14_down } }\n+  C c { 3.0f };\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'C' in initialization\" \"\" { target c++14_down } }\n+\t\t\t// { dg-error \"narrowing conversion of '3.0e.0f' from 'float' to 'int' inside\" \"\" { target c++1z } .-1 }\n+  D d = { 7 };\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'D' in initialization\" \"\" { target *-*-* } }\n };\n \n template <typename H, typename I, typename J, typename K, typename L, typename M>\n@@ -208,11 +208,11 @@ struct U3\n template <typename H, typename I, typename J, typename K>\n struct W3\n {\n-  H a { 5 };\t\t// { dg-error \"invalid conversion from 'int' to 'A'\" \"\" { target *-*-* } .-2 }\n-  I b { 6 };\t\t// { dg-error \"invalid conversion from 'int' to 'B'\" \"\" { target c++14_down } .-3 }\n-  J c { 3.0f };\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'C' in initialization\" \"\" { target c++14_down } .-4 }\n-\t\t\t// { dg-error \"narrowing conversion of '3.0e.0f' from 'float' to 'int' inside\" \"\" { target c++1z } .-5 }\n-  K d = { 7 };\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'D' in initialization\" \"\" { target *-*-* } .-6 }\n+  H a { 5 };\t\t// { dg-error \"invalid conversion from 'int' to 'A'\" \"\" { target *-*-* } }\n+  I b { 6 };\t\t// { dg-error \"invalid conversion from 'int' to 'B'\" \"\" { target c++14_down } }\n+  J c { 3.0f };\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'C' in initialization\" \"\" { target c++14_down } }\n+\t\t\t// { dg-error \"narrowing conversion of '3.0e.0f' from 'float' to 'int' inside\" \"\" { target c++1z } .-1 }\n+  K d = { 7 };\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'D' in initialization\" \"\" { target *-*-* } }\n };\n \n void\n@@ -221,17 +221,9 @@ test ()\n   foo2<0> ();\n   U2<0> u20;\n   U2<1> u21 (5);\n-  W2<0> w2;\t\t// { dg-error \"invalid conversion from 'int' to 'A'\" }\n-\t\t\t// { dg-error \"invalid conversion from 'int' to 'B'\" \"\" { target c++14_down } .-1 }\n-\t\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'C' in initialization\" \"\" { target c++14_down } .-2 }\n-\t\t\t// { dg-error \"narrowing conversion of '3.0e.0f' from 'float' to 'int' inside\" \"\" { target c++1z } .-3 }\n-\t\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'D' in initialization\" \"\" { target *-*-* } .-4 }\n+  W2<0> w2;\t\t// { dg-message \"\" }\n   foo3<A, B, C, D, E, V> ();\n   U3<E> u30;\n   U3<E> u31 (5);\n-  W3<A, B, C, D> w3;\t// { dg-error \"invalid conversion from 'int' to 'A'\" }\n-\t\t\t// { dg-error \"invalid conversion from 'int' to 'B'\" \"\" { target c++14_down } .-1 }\n-\t\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'C' in initialization\" \"\" { target c++14_down } .-2 }\n-\t\t\t// { dg-error \"narrowing conversion of '3.0e.0f' from 'float' to 'int' inside\" \"\" { target c++1z } .-3 }\n-\t\t\t// { dg-error \"cannot convert \\[^\\n\\r]* to 'D' in initialization\" \"\" { target *-*-* } .-4 }\n+  W3<A, B, C, D> w3;\t// { dg-message \"\" }\n }\n","prefixes":[]}