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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 2176F3858C54 for ; Mon, 14 Nov 2022 23:12:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2176F3858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668467536; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jOuGhexcZdPTxM7+uKwI2AyT8MuE4wx9Li4ouQExRwU=; b=gQ6dTqyDY+gRv2dAKFNJs0BmH1VlRJKW1i7H0hlQGCMx1xM+JwUixF2Ik23e8Fxh3QYrAu 5Fm26hvoShhlYAPcy1h5lpSISuzSqrqqkcOf/l1ANspcWxjQNM0WavM1tgZn6YVrFac+PX KnCDrk3AJlyx/2CzkOqX1nDC3t2Ojtc= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-138-8f59glUgNpeUnFJIO1go5Q-1; Mon, 14 Nov 2022 18:12:14 -0500 X-MC-Unique: 8f59glUgNpeUnFJIO1go5Q-1 Received: by mail-qk1-f199.google.com with SMTP id x2-20020a05620a448200b006fa7dad5c1cso12233121qkp.10 for ; Mon, 14 Nov 2022 15:12:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jOuGhexcZdPTxM7+uKwI2AyT8MuE4wx9Li4ouQExRwU=; b=XeejpQlX9/EOU6Hmd5uc8dCi1VRfIBP2Vq5Sa5kGHI83PNkgKIsxWjztK6FMFE6psz HDm6RQd6TtR/68MdFcfbmxbvwrDK30eOEPv6YGxEJEi/iQfNYMum0Cnc4w/GHSxuyCZr GdUJN0R9uhswhKmwN5DUCpc04NQnR/qW5qzyGaIu0cGrYmdCsphI9pir27UVB0W88Zjj SUVHUkhXuIbyc18oPdOR4mhCujTO7baP57m0B/G0bwVeHFW64bR55QjGa6LnTuXQSgEr FyXZlYgVX767zyu3mSPkem3ab0cL2v+1JXgX5Jr4ikxYiHrzpRm7Q8OPZWH2jUK/K8Fi ppqA== X-Gm-Message-State: ANoB5pnZO/gfUaWb3icGjVb/GT2vDOi7EuWPgjdcPOAC3xNHOR7dCtNe 74F+bhXAWLR0Wwd4pAJDCGdEpMlpMX91iT/6isIQGe26WFXVn6NXV0QHhl/rc2cwDM2st36BSiS QDRotuZxx96KqjguGxw== X-Received: by 2002:ad4:4d07:0:b0:4aa:a50e:34c6 with SMTP id l7-20020ad44d07000000b004aaa50e34c6mr14717827qvl.45.1668467533539; Mon, 14 Nov 2022 15:12:13 -0800 (PST) X-Google-Smtp-Source: AA0mqf5S0ADMjOID3go9ANVRf4qpoEoNPBy7OrqaAucQErzxSGgBaR4+v/r1bPni43xlZJlMAEB1nQ== X-Received: by 2002:ad4:4d07:0:b0:4aa:a50e:34c6 with SMTP id l7-20020ad44d07000000b004aaa50e34c6mr14717815qvl.45.1668467533257; Mon, 14 Nov 2022 15:12:13 -0800 (PST) Received: from [192.168.1.101] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id c8-20020ac86608000000b0039d02911555sm6273262qtp.78.2022.11.14.15.12.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Nov 2022 15:12:12 -0800 (PST) Message-ID: <4f427a60-673e-92e5-9d32-754969d0899c@redhat.com> Date: Mon, 14 Nov 2022 18:12:11 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH] c++: Add testcase for DR 2604 To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org References: From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 11/14/22 01:43, Jakub Jelinek wrote: > Hi! > > Working virtually out of Baker Island. > > As the following testcase shows, I think we don't inherit template's > attributes into specializations. > > Tested on x86_64-linux, ok for trunk? OK. > 2022-11-13 Jakub Jelinek > > * g++.dg/DRs/dr2604.C: New test. > > --- gcc/testsuite/g++.dg/DRs/dr2604.C.jj 2022-11-13 23:39:45.725712300 -1200 > +++ gcc/testsuite/g++.dg/DRs/dr2604.C 2022-11-13 23:39:38.712807673 -1200 > @@ -0,0 +1,53 @@ > +// DR 2604 - Attributes for an explicit specialization. > +// { dg-do compile { target c++11 } } > +// { dg-options "-Wunused-parameter" } > + > +template > +[[noreturn]] void > +foo ([[maybe_unused]] int i) > +{ > + for (;;); > +} > + > +template<> > +void > +foo (int i) // { dg-warning "unused parameter 'i'" } > +{ > +} > + > +template > +void > +bar (int i) // { dg-warning "unused parameter 'i'" } > +{ > +} > + > +template<> > +[[noreturn]] void > +bar ([[maybe_unused]] int i) > +{ > + for (;;); > +} > + > +[[noreturn]] void > +baz () > +{ > + foo (0); > +} > + > +[[noreturn]] void > +qux () > +{ > + foo (0); > +} // { dg-warning "'noreturn' function does return" } > + > +[[noreturn]] void > +garply () > +{ > + bar (0); > +} // { dg-warning "'noreturn' function does return" } > + > +[[noreturn]] void > +corge () > +{ > + bar (0); > +} > > Jakub >