From patchwork Mon May 4 16:47:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 1282831 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Rribh7CS; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49G80S0Hplz9sSW for ; Tue, 5 May 2020 02:47:18 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D7814383E83C; Mon, 4 May 2020 16:47:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-qt1-x82f.google.com (mail-qt1-x82f.google.com [IPv6:2607:f8b0:4864:20::82f]) by sourceware.org (Postfix) with ESMTPS id 8DA90383E83C for ; Mon, 4 May 2020 16:47:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 8DA90383E83C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=nathanmsidwell@gmail.com Received: by mail-qt1-x82f.google.com with SMTP id x12so21831qts.9 for ; Mon, 04 May 2020 09:47:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=/iku89xyuaHaJ6iFzXTyItMvsfJ/mnoIjrF1AvFuV1E=; b=Rribh7CS6B+QpQydPL7Ynm8cUCyhq1eTssrMhi8NhnO9WyBj+Rdq38PEATd8sCjbAa AYJHmX076RVrHZXaaX7C/o63nVZ3OJ/hFoDhqdCEQs043VchOHtcCmdgKd+mv9Ci8zJQ ATai8ZNNAr26cRCxfXQ+YCjFXxRLfUfYAB324c/v8CvMSCtLehdOFEyhJB9nlIpWmoMU 8aOCPZLb67AypCTNhmeaKceFGWD08Z6W/tznH3OzzsPQMNGhcwWKUtfKLuIerq9T7N3Q HO8QyLqqo5e1B40z7uSFXO5TdC/rHOPasewNTonUiKoCaVEdOdIsSdKHnYdCP+Jz/oPJ EuOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:from:subject:message-id:date :user-agent:mime-version:content-language; bh=/iku89xyuaHaJ6iFzXTyItMvsfJ/mnoIjrF1AvFuV1E=; b=U0aJVY4cgHnPTGRRnz1DoAi3tbtOg9nAABk2KAfw7V1dmrHN+SZTcpku4KdBnRgYN9 sr2CTAkMaFLDeoEWSyVBqc79nN09x+8MZEj+OM93Q6Hx9I6ofnn55R4upntWdSFtYYGT E06PKK3AP7iY0jZFr11YQOD65sUjNZcurWpp46ZDlhLVXBvJ8T1q5vkPy7HFQ37Nc3r6 IVtpmLACMcMG54b+vCMdbnhbTqdMFPqRoJ5ilpqLS6j3r75mHDnUzbrqoabG/nNHBwLo mU0R2wINVSwlwgJYHKWAG3Y/mvpzCqWofHMh8uwpGk5+QK72gmXbM02w8nvSnte1wQk0 0R3g== X-Gm-Message-State: AGi0PuZvbcXptO41iG1v/Aa64wO83Oz0QjXY5ujhkH+VQxE2oRvBBNBw JWSGsLGFUUeRvChKqASPTNM= X-Google-Smtp-Source: APiQypKcNFuLUtshPHYONHE832XNGUd8bqA3KBYjbpLtymUdmNzU0Qv5cL7G30ID6Qoa2xAZqedp3g== X-Received: by 2002:ac8:4e86:: with SMTP id 6mr17786939qtp.37.1588610832517; Mon, 04 May 2020 09:47:12 -0700 (PDT) Received: from ?IPv6:2620:10d:c0a8:1102:a154:74c:e2c0:f823? ([2620:10d:c091:480::1:fb5b]) by smtp.googlemail.com with ESMTPSA id o43sm11233611qtf.46.2020.05.04.09.47.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 04 May 2020 09:47:11 -0700 (PDT) To: GCC Patches From: Nathan Sidwell Subject: [PR 94827] Don't save tmpl parms in nested requirement Message-ID: Date: Mon, 4 May 2020 12:47:10 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 Content-Language: en-US X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This patch removes the stashing of template parms that Jason noticed was unused when we fixed the 94827 ICE. pushed to trunk. nathan 2020-05-04 Nathan Sidwell PR c++/94827 -- don't save parms in nested requirement * constraint.cc (tsubst_nested_requirement): TYPE directly holds notmalized requirement. (finish_nested_requirement): Don't stash current tpl parms into the requirement. (diagnose_nested_requirement): TYPE directly holds notmalized requirement. diff --git i/gcc/cp/constraint.cc w/gcc/cp/constraint.cc index 85513fecf43..4ad17f3b7d8 100644 --- i/gcc/cp/constraint.cc +++ w/gcc/cp/constraint.cc @@ -2010,7 +2010,7 @@ static tree tsubst_nested_requirement (tree t, tree args, subst_info info) { /* Ensure that we're in an evaluation context prior to satisfaction. */ - tree norm = TREE_VALUE (TREE_TYPE (t)); + tree norm = TREE_TYPE (t); tree result = satisfy_constraint (norm, args, info); if (result == error_mark_node && info.quiet ()) { @@ -2958,16 +2958,9 @@ finish_nested_requirement (location_t loc, tree expr) /* Currently open template headers have dummy arg vectors, so don't pass into normalization. */ tree norm = normalize_constraint_expression (expr, NULL_TREE, false); - tree args = current_template_parms - ? template_parms_to_args (current_template_parms) : NULL_TREE; - - /* Save the normalized constraint and complete set of normalization - arguments with the requirement. We keep the complete set of arguments - around for re-normalization during diagnostics. */ - tree info = build_tree_list (args, norm); /* Build the constraint, saving its normalization as its type. */ - tree r = build1 (NESTED_REQ, info, expr); + tree r = build1 (NESTED_REQ, norm, expr); SET_EXPR_LOCATION (r, loc); return r; } @@ -3370,7 +3363,7 @@ diagnose_nested_requirement (tree req, tree args) { /* Quietly check for satisfaction first. We can elaborate details later if needed. */ - tree norm = TREE_VALUE (TREE_TYPE (req)); + tree norm = TREE_TYPE (req); subst_info info (tf_none, NULL_TREE); tree result = satisfy_constraint (norm, args, info); if (result == boolean_true_node)