{"id":807254,"url":"http://patchwork.ozlabs.org/api/1.2/patches/807254/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/patch/CADzB+2n1=mVOjxWUTRZa68+AoEaF-GDVExPAYFCaTS_KUbwEAA@mail.gmail.com/","project":{"id":17,"url":"http://patchwork.ozlabs.org/api/1.2/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+2n1=mVOjxWUTRZa68+AoEaF-GDVExPAYFCaTS_KUbwEAA@mail.gmail.com>","list_archive_url":null,"date":"2017-08-29T19:50:58","name":"C++ PATCH for various small fixes","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"7e166873866c3100f43011d1bfd35cc06826ba3e","submitter":{"id":4337,"url":"http://patchwork.ozlabs.org/api/1.2/people/4337/?format=json","name":"Jason Merrill","email":"jason@redhat.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/gcc/patch/CADzB+2n1=mVOjxWUTRZa68+AoEaF-GDVExPAYFCaTS_KUbwEAA@mail.gmail.com/mbox/","series":[{"id":455,"url":"http://patchwork.ozlabs.org/api/1.2/series/455/?format=json","web_url":"http://patchwork.ozlabs.org/project/gcc/list/?series=455","date":"2017-08-29T19:50:58","name":"C++ PATCH for various small fixes","version":1,"mbox":"http://patchwork.ozlabs.org/series/455/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/807254/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/807254/checks/","tags":{},"related":[],"headers":{"Return-Path":"<gcc-patches-return-461116-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-461116-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=\"xJYDiqP0\"; 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 3xhfQr0T6Jz9sNc\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 30 Aug 2017 05:51:31 +1000 (AEST)","(qmail 89097 invoked by alias); 29 Aug 2017 19:51:23 -0000","(qmail 89079 invoked by uid 89); 29 Aug 2017 19:51:22 -0000","from mail-io0-f176.google.com (HELO mail-io0-f176.google.com)\n\t(209.85.223.176) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tTue, 29 Aug 2017 19:51:21 +0000","by mail-io0-f176.google.com with SMTP id n71so25172600iod.1 for\n\t<gcc-patches@gcc.gnu.org>; Tue, 29 Aug 2017 12:51:21 -0700 (PDT)","by 10.107.181.23 with HTTP; Tue, 29 Aug 2017 12:50:58 -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=qQ84Yixs97FuH+ZC/uox8Y3Gw4CWctrdqg6y4AfMAf+O6F\n\tFC/efJY8URSsd5p7ovPphQBIcrwjoKmKLTYP4sbG0jCx12FPbTkd9P4S63YsnEwE\n\t2jAUrl05TcnrbEQeuOm86MlcNoEUYVUkwftHsMJfT1YqFAkJv+ib5L4RUnZSM=","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=qIZE3cYG4sht63qmieX5DL/zfcE=; b=xJYDiqP0Soxaw9+8ekTC\n\tCPvGdYqtuPVccaeUZup+d+iskQT5GIbMgaYdV85+KK/Xu5uxu8MbLHssHzNTtzAy\n\t79AFtxZUCimEKp426pzOj0P9Xqj8kqgR+8e2neVOJtUkyPLgYXuEzLViG4KSWxLC\n\tEdlIBm1q+pvC3oQbvWzbqnk=","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=","X-HELO":"mail-io0-f176.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=FfeoJtiVM/PtAxWrqyAFtVXwWcDFALlX5dXiDOGlmDc=;\n\tb=caXb7Pcb2DYhivnqfL5NgBddyiCiJClpuHRtq2J9RKocudV9DYzWpJ2CSJxv3KfzLe\n\toaPYtor9DZr6MDPH3MyHcYDAdLnAxdGWKEJlPQhuMPefakubnkA+eF2hLOvviDrrwnEH\n\tbYCxQ/qP+PtucdpEpB4lF2lOpflZXZ/r1xuJ7Ou3pI+U1AqjSmaKceMDO0lR9tyfamlj\n\tvVjKmMTScBy+hIFeekkvP3+CkkaDuqMRGuquLHJh+ZfqE9nGqbWf/MSeIWQlMN/QZNlI\n\tUG6jUe1uBTOHrjS44RZQlPFca6xkiRD/dPimNuryneyvYU1H2f6yNPOOVE60D/GL488h\n\toJfA==","X-Gm-Message-State":"AHYfb5jjWlPhIbzLXxrJ3xRSvHaBvVeb7UAKWNr5rB83yYhnQpwmUt5D\tRsqCRiknumuNt1RiE6JnvvAkFNqLa1BD8tM=","X-Received":"by 10.107.32.14 with SMTP id g14mr5353407iog.147.1504036278591;\n\tTue, 29 Aug 2017 12:51:18 -0700 (PDT)","MIME-Version":"1.0","From":"Jason Merrill <jason@redhat.com>","Date":"Tue, 29 Aug 2017 15:50:58 -0400","Message-ID":"<CADzB+2n1=mVOjxWUTRZa68+AoEaF-GDVExPAYFCaTS_KUbwEAA@mail.gmail.com>","Subject":"C++ PATCH for various small fixes","To":"gcc-patches List <gcc-patches@gcc.gnu.org>","Content-Type":"multipart/mixed; boundary=\"001a1140c1d62ddb200557e9bc91\"","X-IsSubscribed":"yes"},"content":"Various small things I noticed while working on the lambda overhaul:\n\nWe try to avoid mentioning the lambda conversion static thunk in\ndiagnostics, but it was showing up in constexpr messages.\n\nIf the lambda itself is erroneous, don't try to build a closure object.\n\nWe can't defer instantiation of a function with undeduced auto type.\n\ntsubst_decl should set the DECL_CONTEXT on function parameters immediately.\n\nDon't build a non-type parameter with erroneous type.\n\nTested x86_64-pc-linux-gnu, applying to trunk.\ncommit 98a3f06a6ef75905a280209cd176d154e0ca7387\nAuthor: Jason Merrill <jason@redhat.com>\nDate:   Wed Aug 23 15:46:01 2017 -0400\n\n            Various small fixes.\n    \n            * lambda.c (build_lambda_object): Check for error_mark_node.\n            * pt.c (make_pack_expansion): Set PACK_EXPANSION_LOCAL_P on the type\n            pack as well.\n            (tsubst_decl) [FUNCTION_DECL]: Set DECL_CONTEXT on the parameters.\n            (tsubst) [TEMPLATE_PARM_INDEX]: Check for error_mark_node.","diff":"diff --git a/gcc/cp/constexpr.c b/gcc/cp/constexpr.c\nindex 8cfc5a4..daeec9d 100644\n--- a/gcc/cp/constexpr.c\n+++ b/gcc/cp/constexpr.c\n@@ -1458,7 +1458,8 @@ cxx_eval_call_expression (const constexpr_ctx *ctx, tree t,\n     {\n       if (!ctx->quiet)\n \t{\n-\t  error_at (loc, \"call to non-constexpr function %qD\", fun);\n+\t  if (!lambda_static_thunk_p (fun))\n+\t    error_at (loc, \"call to non-constexpr function %qD\", fun);\n \t  explain_invalid_constexpr_fn (fun);\n \t}\n       *non_constant_p = true;\ndiff --git a/gcc/cp/lambda.c b/gcc/cp/lambda.c\nindex 14ff6c2..337b9ee 100644\n--- a/gcc/cp/lambda.c\n+++ b/gcc/cp/lambda.c\n@@ -59,7 +59,7 @@ build_lambda_object (tree lambda_expr)\n   tree node, expr, type;\n   location_t saved_loc;\n \n-  if (processing_template_decl)\n+  if (processing_template_decl || lambda_expr == error_mark_node)\n     return lambda_expr;\n \n   /* Make sure any error messages refer to the lambda-introducer.  */\ndiff --git a/gcc/cp/pt.c b/gcc/cp/pt.c\nindex 416d17b..aaae06d 100644\n--- a/gcc/cp/pt.c\n+++ b/gcc/cp/pt.c\n@@ -3773,6 +3773,7 @@ make_pack_expansion (tree arg)\n       purpose = cxx_make_type (TYPE_PACK_EXPANSION);\n       SET_PACK_EXPANSION_PATTERN (purpose, TREE_PURPOSE (arg));\n       PACK_EXPANSION_PARAMETER_PACKS (purpose) = parameter_packs;\n+      PACK_EXPANSION_LOCAL_P (purpose) = at_function_scope_p ();\n \n       /* Just use structural equality for these TYPE_PACK_EXPANSIONS;\n \t they will rarely be compared to anything.  */\n@@ -9535,6 +9536,7 @@ static inline bool\n neglectable_inst_p (tree d)\n {\n   return (DECL_P (d)\n+\t  && !undeduced_auto_decl (d)\n \t  && !(TREE_CODE (d) == FUNCTION_DECL ? DECL_DECLARED_CONSTEXPR_P (d)\n \t       : decl_maybe_constant_var_p (d)));\n }\n@@ -12413,6 +12415,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)\n \n \tDECL_ARGUMENTS (r) = tsubst (DECL_ARGUMENTS (t), args,\n \t\t\t\t     complain, t);\n+\tfor (tree parm = DECL_ARGUMENTS (r); parm; parm = DECL_CHAIN (parm))\n+\t  DECL_CONTEXT (parm) = r;\n \tDECL_RESULT (r) = NULL_TREE;\n \n \tTREE_STATIC (r) = 0;\n@@ -13786,6 +13790,8 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)\n \t       couldn't do it earlier because it might be an auto parameter,\n \t       and we wouldn't need to if we had an argument.  */\n \t    type = tsubst (type, args, complain, in_decl);\n+\t    if (type == error_mark_node)\n+\t      return error_mark_node;\n \t    r = reduce_template_parm_level (t, type, levels, args, complain);\n \t    break;\n \n","prefixes":[]}