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.129.124]) by sourceware.org (Postfix) with ESMTPS id D3B053858416 for ; Wed, 28 Jun 2023 15:50:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D3B053858416 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=1687967438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3t2F8a3Fn5c3h7jXMNXLtkyZKWZssASeCoW6HJjdx2I=; b=EmAPVv09QywmigONoJf2O6gImZ6y4lc+VBeU40zZ6Neds1wekVLMIafsPAaCbZPb5YJnNg S3DyxrToZ6gEqteEw+UlACzOXHcLcMjepVbyIlrJm9kBllpflB5BKoLrAG6WnqTc81BWRs cKmYKQVQZP2W+O0MduIuCrU9zjTFAzk= Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-563-Bc31_TB4NDemchrOIZ3B4Q-1; Wed, 28 Jun 2023 11:50:36 -0400 X-MC-Unique: Bc31_TB4NDemchrOIZ3B4Q-1 Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-76531f671c0so584814685a.1 for ; Wed, 28 Jun 2023 08:50:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687967430; x=1690559430; h=content-transfer-encoding:in-reply-to:from:references: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=3t2F8a3Fn5c3h7jXMNXLtkyZKWZssASeCoW6HJjdx2I=; b=DCRywqKmv7HIKKZvMQCPIo1JtQYF370X4AXO5wEuGrYx9xPKhnNKeW3sH2iQ+JZWEF XdAzHt29nD4TWPoUwtFllCh2QyPNggAVZUe7zI74MDVbsjOfCFY82lVn5dQ7gAWR7/UL UrGyS+JVbZ3fr1S4BQrMmcYkVf1M9gydqFaJjOLuCZGElgF2e98Q4LjnRk8hmiOMcoO5 +D2+mRUEuIoekjggaO3BAfnxOGXvJiOfcUJHvfeeDtVWFfGCqdky1WJNGKIs5oIdTAwt gR2iqejuUyZhk+MIgXch96+carL/hJfS4upau851pyEkCWmT8IquNCt4H9aqphaWCzlA bdvg== X-Gm-Message-State: AC+VfDxoNe7MAPKAbBbXbzOT8ObZSUOGPg7V9bgoHywBy/BZAX3gxNgT No8TJyFF+4WU2TSGhRBvWC63bdv9TY5TIi87Q/GDFH2NT82RxcQ7xA1o49NH/T24I5vFtj99mG0 Db5/5lkmqpuZuhGVAkQ== X-Received: by 2002:a05:620a:2a07:b0:767:2919:f380 with SMTP id o7-20020a05620a2a0700b007672919f380mr1538304qkp.35.1687967430268; Wed, 28 Jun 2023 08:50:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ61ZWBriRixNJYygMECXhFEO0eJYUx4iU0WS0eYCZDnYgjF6frb7fmjeDS/brwjMJwotxuaiw== X-Received: by 2002:a05:620a:2a07:b0:767:2919:f380 with SMTP id o7-20020a05620a2a0700b007672919f380mr1538293qkp.35.1687967429988; Wed, 28 Jun 2023 08:50:29 -0700 (PDT) Received: from [192.168.1.108] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id i11-20020a05620a150b00b00761ff1e23e1sm1947239qkk.109.2023.06.28.08.50.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Jun 2023 08:50:29 -0700 (PDT) Message-ID: <4a14d6c2-1478-a6ad-8966-9e05c5fb6329@redhat.com> Date: Wed, 28 Jun 2023 11:50:27 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH] c++: fix error reporting routines re-entered ICE [PR110175] To: Marek Polacek , GCC Patches References: <20230623222525.547651-1-polacek@redhat.com> From: Jason Merrill In-Reply-To: <20230623222525.547651-1-polacek@redhat.com> 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=-12.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham 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 6/23/23 18:25, Marek Polacek wrote: > Here we get the "error reporting routines re-entered" ICE because > of an unguarded use of warning_at. While at it, I added a check > for a warning_at just above it. > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? OK. > PR c++/110175 > > gcc/cp/ChangeLog: > > * typeck.cc (cp_build_unary_op): Check tf_warning before warning. > > gcc/testsuite/ChangeLog: > > * g++.dg/cpp0x/decltype-110175.C: New test. > --- > gcc/cp/typeck.cc | 5 +++-- > gcc/testsuite/g++.dg/cpp0x/decltype-110175.C | 6 ++++++ > 2 files changed, 9 insertions(+), 2 deletions(-) > create mode 100644 gcc/testsuite/g++.dg/cpp0x/decltype-110175.C > > diff --git a/gcc/cp/typeck.cc b/gcc/cp/typeck.cc > index da591dafc8f..859b133a18d 100644 > --- a/gcc/cp/typeck.cc > +++ b/gcc/cp/typeck.cc > @@ -7561,7 +7561,8 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool noconvert, > /* [depr.volatile.type] "Postfix ++ and -- expressions and > prefix ++ and -- expressions of volatile-qualified arithmetic > and pointer types are deprecated." */ > - if (TREE_THIS_VOLATILE (arg) || CP_TYPE_VOLATILE_P (TREE_TYPE (arg))) > + if ((TREE_THIS_VOLATILE (arg) || CP_TYPE_VOLATILE_P (TREE_TYPE (arg))) > + && (complain & tf_warning)) > warning_at (location, OPT_Wvolatile, > "%qs expression of %-qualified type is " > "deprecated", > @@ -7592,7 +7593,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, bool noconvert, > return error_mark_node; > } > /* Otherwise, [depr.incr.bool] says this is deprecated. */ > - else > + else if (complain & tf_warning) > warning_at (location, OPT_Wdeprecated, > "use of an operand of type %qT " > "in % is deprecated", > diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype-110175.C b/gcc/testsuite/g++.dg/cpp0x/decltype-110175.C > new file mode 100644 > index 00000000000..39643cafcf8 > --- /dev/null > +++ b/gcc/testsuite/g++.dg/cpp0x/decltype-110175.C > @@ -0,0 +1,6 @@ > +// PR c++/110175 > +// { dg-do compile { target c++11 } } > + > +template auto f(T t) -> decltype(++t) { return t; } // { dg-warning "reference" "" { target c++14_down } } > +void f(...) {} > +void g() { f(true); } > > base-commit: 5388a43f6a3f348929292998bd6d0c1da6f006de