From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 6CEF83953C38 for ; Tue, 22 Jun 2021 20:05:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6CEF83953C38 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-13-WMNXZg4qP7qFxDuuxTVI-w-1; Tue, 22 Jun 2021 16:05:27 -0400 X-MC-Unique: WMNXZg4qP7qFxDuuxTVI-w-1 Received: by mail-wr1-f72.google.com with SMTP id k25-20020a5d52590000b0290114dee5b660so10187767wrc.16 for ; Tue, 22 Jun 2021 13:05:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TsSXu0BzKWpVviDAnqeDuW5Om6XNs/U0Hf5tONAKFSM=; b=ZJpx69L7UZ7KqdVBdcMis1c8zG5i05GOiRS0mcVd6qOdeK94HFvnGE1kn6w1rXJYzR eFwov6zLkwYlIGKUiiGp0YytSrMoStMZjO4b8W0fqV6JjW4Dj/+po5GQdRuTSO5AVTRK v3HmK8hcylADW4bnlGFptEY3vvTUsN70RSlsZIYXntYYAl5A1bi+S3uj0v4EsAZ+AGLH /+SsrI3W3R9rCouQfMuKFrtGCCH0E1jNZElfBbH++qeSaNInYEegYOhoWv4JA8/HQu0Y 6F+PZsdHFb582CwVOiT6sjZPLXYGG0jFbec2ufmedWkkdfVkoiqfZzSHMdMNfsNchEBM PdTw== X-Gm-Message-State: AOAM532xr+GeVv3g7YWe/JwHzfoi3aR86NyJqQIpaehcVqaCV4HTbpNH UYzmJBVXbDAeIoA+4Mf2NOLA8M2Het+N9fwY/2dBLWAgZZ10aFTV+WCs+OXWXVy7JcJdUDzVo8H I0SImjzBW1UEm4IbfQD2a5MclOvsJKh0= X-Received: by 2002:a05:6000:cb:: with SMTP id q11mr7143867wrx.13.1624392326559; Tue, 22 Jun 2021 13:05:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiF1QZ8nnpQuuV/bK4Baao/mQ7Py5yHmPe7SCzBS4W9A5wyErPfhSV8ckKHuOUrRVtAlmuQEEGTC0N5ImXPlQ= X-Received: by 2002:a05:6000:cb:: with SMTP id q11mr7143856wrx.13.1624392326419; Tue, 22 Jun 2021 13:05:26 -0700 (PDT) MIME-Version: 1.0 References: <20210622184514.1337889-1-ppalka@redhat.com> In-Reply-To: <20210622184514.1337889-1-ppalka@redhat.com> From: Jonathan Wakely Date: Tue, 22 Jun 2021 21:05:13 +0100 Message-ID: Subject: Re: [PATCH] c++: CTAD and deduction guide selection [PR86439] To: Patrick Palka Cc: gcc Patches , "libstdc++" , jason@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jun 2021 20:05:30 -0000 On Tue, 22 Jun 2021 at 19:45, Patrick Palka wrote: > This change causes us to reject some container CTAD examples in the > libstdc++ testsuite due to deduction failure for {}, which AFAICT is the > correct behavior. Previously, in the case of e.g. the first removed > example for std::map, the type of {} would be deduced to less as a > side effect of forming the call to the selected guide > > template, > typename _Allocator = allocator>, > typename = _RequireNotAllocator<_Compare>, > typename = _RequireAllocator<_Allocator>> > map(initializer_list>, > _Compare = _Compare(), _Allocator = _Allocator()) > -> map<_Key, _Tp, _Compare, _Allocator>; > > which made later overload resolution for the constructor call > unambiguous. Now, the type of {} remains undeduced until constructor > overload resolution, and we complain about ambiguity with the two > constructors > > map(initializer_list __l, > const _Compare& __comp = _Compare(), > const allocator_type& __a = allocator_type()) > > map(initializer_list __l, const allocator_type& __a) > > This patch just removes these problematic container CTAD examples. Do all the problematic cases have a corresponding case that doesn't use {} but uses an actual type? If not, we might want to add such cases, to ensure we're still covering all the cases that really *should* work.