From patchwork Mon Mar 5 18:43:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Sidwell X-Patchwork-Id: 881598 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-474291-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=acm.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ov8tIOLv"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zw81g039Sz9sXl for ; Tue, 6 Mar 2018 05:43:34 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=GjFQVuozR/nPlpLNdMY9Eq1vQOqpj7hRl1Fx8R5kzkRyUibzm/ jz8eYsOeCd0G94DJLM5RMZ84ib/4sHIw6gxOZO928Ic9dNuRP4wAKZBFsWCmkYZY xa7/2T7pmgtWLB28ymIYtjiDQvdCDIpTplrQVAwJb+dlrRyz9yJiXQ0Rs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=H6NKWJJCPdXxQUOr8zPoT2Z0Kj8=; b=ov8tIOLvla0KUpTmg3av 7SCyc5FB70V7uFdhQmV8VBC1cpEiwoDqIxBwUEXGdlNPtIPOUahNVAfBXyR0qKwM 9ds54Flx/x8Uv79L1L2ejSK8knd3Pez45zld1mdZHhQr+i08si58IvVVjQL0BiLy 2EuWx3/DMbuN9HsMxd3zViU= Received: (qmail 68540 invoked by alias); 5 Mar 2018 18:43:27 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 67456 invoked by uid 89); 5 Mar 2018 18:43:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.1 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-yb0-f176.google.com Received: from mail-yb0-f176.google.com (HELO mail-yb0-f176.google.com) (209.85.213.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 05 Mar 2018 18:43:21 +0000 Received: by mail-yb0-f176.google.com with SMTP id w9-v6so2396503ybe.13 for ; Mon, 05 Mar 2018 10:43:21 -0800 (PST) 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=UrWC347eiKLnu3sBKpnR+r/OtdeBO5dKa6yDAY9Bzcw=; b=TFJ3ATJYP8v9C3SftAj19egvPXXMsWO4Moqd7DsApYk04MNK61J/2lMbkJ/zkTrHuA +ctsI8rkqe/S73bZ6rAR9Qu6FsjX6D1uYP5PI1O6+ZHjrunxcRC3dLnalJ3bNPjp2Z70 syv6Vo5b0hdPEoeFSJ46g0NJUBqxy2RuhTqdSdzuGRQwCzpDhAuREWi8qjejNlAtfef4 aj07pF/5HTXNgQz2+yVaf1vH9iUKbiHHmmRvHiKhtzV/UxTwMkpo2/DRFfmciURkxkMN K46OKQG9L7dmQbkFtPFPfqONx7Q5FwM+cmgBxsx+zncxFOWHOcFEO9YN/Yi/GhbHeMdG 8dQQ== X-Gm-Message-State: APf1xPANdoZg4c0Hck0L7lk3BHd42k0IlogoaqQlA+W7jr43/3bfwN+S 7Qi4w8NLb0DPRCD6kTDUJys= X-Google-Smtp-Source: AG47ELtasqfn6DRoNXweOn5n5Ww/5fZxABnPGGBe1m6cp6h1lUNj3l1ZankzcvGZ5vE7p2CU0rrt3g== X-Received: by 2002:a25:b687:: with SMTP id s7-v6mr9462659ybj.256.1520275400124; Mon, 05 Mar 2018 10:43:20 -0800 (PST) Received: from ?IPv6:2620:10d:c0a3:20fb:7500:e7fb:4a6f:2254? ([2620:10d:c091:200::1:7aef]) by smtp.googlemail.com with ESMTPSA id a21sm5214279ywa.79.2018.03.05.10.43.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Mar 2018 10:43:19 -0800 (PST) To: GCC Patches From: Nathan Sidwell Subject: [PR c++/84702] ICE with default tmpl arg of overload set Message-ID: <8ea07f0e-6780-c038-8024-eff34af4b81b@acm.org> Date: Mon, 5 Mar 2018 13:43:18 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 This fixes an ICE where we were not correctly marking a lookup as kept, resulting in an assertion failure later on. nathan 2018-03-05 Nathan Sidwell PR c++/84702 * pt.c (process_template_arg): Mark lookup_keep on a default arg. PR c++/84702 * g++.dg/lookup/pr84702.C: New. Index: cp/pt.c =================================================================== --- cp/pt.c (revision 258254) +++ cp/pt.c (working copy) @@ -4425,6 +4425,9 @@ process_template_parm (tree list, locati pushdecl (decl); + if (defval && TREE_CODE (defval) == OVERLOAD) + lookup_keep (defval, true); + /* Build the parameter node linking the parameter declaration, its default argument (if any), and its constraints (if any). */ parm = build_tree_list (defval, parm); Index: testsuite/g++.dg/lookup/pr84702.C =================================================================== --- testsuite/g++.dg/lookup/pr84702.C (revision 0) +++ testsuite/g++.dg/lookup/pr84702.C (working copy) @@ -0,0 +1,13 @@ +// PR c++/84702 failure to mark overload to keep +// { dg-do compile { target c++11 } } + +void a (); + +namespace { + void a (int); +} + +template +void c () { + c (); +}