From patchwork Mon Sep 18 16:12:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 76299 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 053D338560B9 for ; Mon, 18 Sep 2023 16:12:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 053D338560B9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695053560; bh=x1MFqq6SZESWA5p83NvXgSGREUx1dankFWKUApjmaMc=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=ECHWr8iuBlnPyE10VxsAvhHa+vlR3lgwEJLxDiUEV5Dao885X3lJRGFauGJcBEVHa I3TWEYp5Hmts3K0g6NbhUmUE/RmGo8LfNBNhsch0O44gpxla4ZW2NzjxGZNVUD876d zX0805yA7iI3/tpbsWSpc8OdkSrjMRdgYbWoze7E= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 CBE063857722 for ; Mon, 18 Sep 2023 16:12:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CBE063857722 Received: from mail-oa1-f69.google.com (mail-oa1-f69.google.com [209.85.160.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-283-Npmm1xA9PZOT8l15lMgUHg-1; Mon, 18 Sep 2023 12:12:08 -0400 X-MC-Unique: Npmm1xA9PZOT8l15lMgUHg-1 Received: by mail-oa1-f69.google.com with SMTP id 586e51a60fabf-1d6cc105ba6so2373426fac.2 for ; Mon, 18 Sep 2023 09:12:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695053527; x=1695658327; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=x1MFqq6SZESWA5p83NvXgSGREUx1dankFWKUApjmaMc=; b=Kx+PO7YZZ+Mvr1axSEMJarlQFKzD0AYphLE7e00qZvaQI7PASudCcTFrUE5VvM6NY9 h/y8NEFBfCptCRK9JetxJI863i1qEFOlKOEb5lpBLFC4UbD8F+p0c0ViMOsF28Byu5pK uFxD2vIU0jAgTUvj+OgeJLycBk5lP3Obb6x+oqKhLoQ1GIwVCka+LeDOMmmgDCjsqVsA ZIwwqF5Sd5+37GLmE6Ah1PuAHEJQ+UOxquzP/wP8crl1Kb8JDV+RMidV0gHTK1R4q2MM cCbgO8r9E0sGCViqcRaEOw/GK9PwhmxxrrPks0K8h4lylpU3WN+c14eMRwQgd7+/v8lb PLLw== X-Gm-Message-State: AOJu0YzMDApLDBpJvXmqbzlKHEdtRVAmUMDKr3a5+xjPRY39J4AMd/B+ 2fRYPjOB9xsRLXJsGiFS1Bt7lTEA7/zeyFfzc1FyEQcwlte+0l9yWSbiISCsdkq+dhiOppwVFzY MK5eu/ueY5A/IKQ8QhqogJgDHyDjlEXls/vodm5ff/G7Hack4+v+rxvHm3IZVSC7REetY51+8Jg 8= X-Received: by 2002:a05:6870:e387:b0:1be:e6d6:15c4 with SMTP id x7-20020a056870e38700b001bee6d615c4mr10342597oad.9.1695053526772; Mon, 18 Sep 2023 09:12:06 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHagQq3+KoaxMiY+KtN7MxD8jDD2siu+YiJYGj47zu69zSL94dGongEadIr2Ri4V6wg8BvXkQ== X-Received: by 2002:a05:6870:e387:b0:1be:e6d6:15c4 with SMTP id x7-20020a056870e38700b001bee6d615c4mr10342559oad.9.1695053526245; Mon, 18 Sep 2023 09:12:06 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id h2-20020a0cb4c2000000b006577e289d35sm1190909qvf.58.2023.09.18.09.12.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 09:12:05 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com, Patrick Palka Subject: [PATCH v2 1/2] c++: overeager type completion in convert_to_void [PR111419] Date: Mon, 18 Sep 2023 12:12:01 -0400 Message-ID: <20230918161202.2884010-1-ppalka@redhat.com> X-Mailer: git-send-email 2.42.0.216.gbda494f404 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Patrick Palka via Gcc-patches From: Patrick Palka Reply-To: Patrick Palka Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here convert_to_void always completes the type of an indirection or id-expression, but according to [expr.context] an lvalue-to-rvalue conversion is applied to a discarded-value expression only if "the expression is a glvalue of volatile-qualified type". This patch restricts convert_to_void's type completion to match. PR c++/111419 gcc/cp/ChangeLog: * cvt.cc (convert_to_void) : Only call complete_type if the type is volatile. : Only call complete_type if the type is volatile. Likewise. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-requires36.C: New test. * g++.dg/expr/discarded1.C: New test. * g++.dg/expr/discarded1a.C: New test. --- gcc/cp/cvt.cc | 10 ++++++---- .../g++.dg/cpp2a/concepts-requires36.C | 16 ++++++++++++++++ gcc/testsuite/g++.dg/expr/discarded1.C | 15 +++++++++++++++ gcc/testsuite/g++.dg/expr/discarded1a.C | 17 +++++++++++++++++ 4 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-requires36.C create mode 100644 gcc/testsuite/g++.dg/expr/discarded1.C create mode 100644 gcc/testsuite/g++.dg/expr/discarded1a.C diff --git a/gcc/cp/cvt.cc b/gcc/cp/cvt.cc index c6b52f07050..4424670356c 100644 --- a/gcc/cp/cvt.cc +++ b/gcc/cp/cvt.cc @@ -1250,9 +1250,10 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain) case INDIRECT_REF: { tree type = TREE_TYPE (expr); - int is_reference = TYPE_REF_P (TREE_TYPE (TREE_OPERAND (expr, 0))); int is_volatile = TYPE_VOLATILE (type); - int is_complete = COMPLETE_TYPE_P (complete_type (type)); + if (is_volatile) + complete_type (type); + int is_complete = COMPLETE_TYPE_P (type); /* Can't load the value if we don't know the type. */ if (is_volatile && !is_complete) @@ -1412,9 +1413,10 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain) { /* External variables might be incomplete. */ tree type = TREE_TYPE (expr); - int is_complete = COMPLETE_TYPE_P (complete_type (type)); - if (TYPE_VOLATILE (type) && !is_complete && (complain & tf_warning)) + if (TYPE_VOLATILE (type) + && !COMPLETE_TYPE_P (complete_type (type)) + && (complain & tf_warning)) switch (implicit) { case ICV_CAST: diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-requires36.C b/gcc/testsuite/g++.dg/cpp2a/concepts-requires36.C new file mode 100644 index 00000000000..8d3a4fcd2aa --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-requires36.C @@ -0,0 +1,16 @@ +// PR c++/111419 +// { dg-do compile { target c++20 } } + +template +concept invocable = requires(F& f) { f(); }; + +template +concept deref_invocable = requires(F& f) { *f(); }; + +struct Incomplete; + +template +struct Holder { T t; }; + +static_assert(invocable& ()>); +static_assert(deref_invocable* ()>); diff --git a/gcc/testsuite/g++.dg/expr/discarded1.C b/gcc/testsuite/g++.dg/expr/discarded1.C new file mode 100644 index 00000000000..c0c22e9e95b --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/discarded1.C @@ -0,0 +1,15 @@ +// PR c++/111419 + +struct Incomplete; + +template struct Holder { T t; }; // { dg-bogus "incomplete" } + +extern Holder a; +extern Holder& b; +extern Holder* c; + +int main() { + a; + b; + *c; +} diff --git a/gcc/testsuite/g++.dg/expr/discarded1a.C b/gcc/testsuite/g++.dg/expr/discarded1a.C new file mode 100644 index 00000000000..1c4dff4553e --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/discarded1a.C @@ -0,0 +1,17 @@ +// A version of discarded1.C using volatile types. +// PR c++/111419 + +struct Incomplete; + +template struct Holder { T t; }; // { dg-error "incomplete" } + +extern volatile Holder a; +extern volatile Holder& b; +extern volatile Holder* c; + +int main() { + a; // { dg-message "required from here" } + b; // { dg-message "required from here" } + // { dg-warning "implicit dereference will not access object" "" { target *-*-* } .-1 } + *c; // { dg-message "required from here" } +} From patchwork Mon Sep 18 16:12:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 76300 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B05CC38582B7 for ; Mon, 18 Sep 2023 16:13:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B05CC38582B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1695053616; bh=Ys4sS7VPvlui4SkSMahgy0s/y5cJoESvVztlg4SCN8A=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=ie3FHegyjvlAVmZ6jp0EKzbNnts66SaiftgKONnjHH0WkdcpnWwXisqKWpQKLFmQS zLBnJ3H1WTreVkRO8e/rZHxMGYEN6ygx8QFPX/OxwzuG5D2kO3DcTheXTw32y/2JW1 FcHrINtbCpYZQBYt0tH+dwKILZsnfifOEadsA+Q0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 2F9AC3856DFB for ; Mon, 18 Sep 2023 16:12:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F9AC3856DFB Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-624-AVQz_XFqNyOeBYNu5GH2EQ-1; Mon, 18 Sep 2023 12:12:10 -0400 X-MC-Unique: AVQz_XFqNyOeBYNu5GH2EQ-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-6564b4f78dfso16184596d6.1 for ; Mon, 18 Sep 2023 09:12:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695053528; x=1695658328; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ys4sS7VPvlui4SkSMahgy0s/y5cJoESvVztlg4SCN8A=; b=rZ8I6eGlsn7qXE3Rja/yloy6UXQrFr+5gl6FM305XNgRP5kLncFIfJYuqFvv1/KaVv sMbwT+rGnRafAfCvvFylUjAflonnus91ejsDFg5CvJVEbnknJUKuXFlvzusVxE2hkFQs hSKDpwM30oS+RootQmWZ/l9LLuHJiMo6Z7+jaIdNkh1Y3oiQbr0ph+UKEPfv65xhje7P BwoaNmvn72rGkB5RZH/C5b3oWNS1h0cR5mKce5XlMQI8nZa6Rgksq8E6M0mM6jK5QBRc PleYL7AQPaKH3LDT8xq58rozFO8rc4sTYG0j8jJJfnvQYLu2Pq9BP7EUNpT5GCZzv/3W uYuQ== X-Gm-Message-State: AOJu0YzUgMO/CS33kTtvAWNjXE3cbT7vUh34CbqbDNpac4yFkCYfWLor ONZnw+EaQEJPFqFzuDKdfC5knOzkqt7pz3tHFWKldEgSRaaLFLC8g0om4yaTnb4PhW+DnF5wxMi Nhm3dpFD+9uz3oQscsLRc0u+pZRk/7eIdq9dCEJFhvXscnYCAm7eGKNu/jAcB/EXoNZWyBMROio E= X-Received: by 2002:ad4:410b:0:b0:63f:bf70:6796 with SMTP id i11-20020ad4410b000000b0063fbf706796mr9264357qvp.58.1695053528500; Mon, 18 Sep 2023 09:12:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/+rF4L4koOGrvtWIHxlmlJa79UTDRL3tuqjzLzK+EqszOq3HE6Dr4TKkko7dRJPEURvTDcQ== X-Received: by 2002:ad4:410b:0:b0:63f:bf70:6796 with SMTP id i11-20020ad4410b000000b0063fbf706796mr9264329qvp.58.1695053528061; Mon, 18 Sep 2023 09:12:08 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id h2-20020a0cb4c2000000b006577e289d35sm1190909qvf.58.2023.09.18.09.12.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 09:12:07 -0700 (PDT) To: gcc-patches@gcc.gnu.org Cc: jason@redhat.com, Patrick Palka Subject: [PATCH v2 2/2] c++: convert_to_void and volatile references Date: Mon, 18 Sep 2023 12:12:02 -0400 Message-ID: <20230918161202.2884010-2-ppalka@redhat.com> X-Mailer: git-send-email 2.42.0.216.gbda494f404 In-Reply-To: <20230918161202.2884010-1-ppalka@redhat.com> References: <20230918161202.2884010-1-ppalka@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-13.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Patrick Palka via Gcc-patches From: Patrick Palka Reply-To: Patrick Palka Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Jason pointed out that even implicit loads of volatile references need to undergo lvalue-to-rvalue conversion, but we currently emit a warning in this case and discard the load. This patch changes this behavior so that we don't issue a warning, and preserve the load. gcc/cp/ChangeLog: * cvt.cc (convert_to_void) : Remove warning for an implicit load of a volatile reference. Simplify as if is_reference is false. Check REFERENCE_REF_P in the test guarding the -Wunused-value diagnostic. gcc/testsuite/ChangeLog: * g++.dg/expr/discarded1a.C: No longer expect warning for implicit load of a volatile reference. * g++.old-deja/g++.bugs/900428_01.C: Likewise. * g++.dg/expr/volatile2.C: New test. --- gcc/cp/cvt.cc | 56 ++----------------- gcc/testsuite/g++.dg/expr/discarded1a.C | 1 - gcc/testsuite/g++.dg/expr/volatile2.C | 12 ++++ .../g++.old-deja/g++.bugs/900428_01.C | 26 ++++----- 4 files changed, 30 insertions(+), 65 deletions(-) create mode 100644 gcc/testsuite/g++.dg/expr/volatile2.C diff --git a/gcc/cp/cvt.cc b/gcc/cp/cvt.cc index 4424670356c..1cb6c1222c2 100644 --- a/gcc/cp/cvt.cc +++ b/gcc/cp/cvt.cc @@ -1251,12 +1251,9 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain) { tree type = TREE_TYPE (expr); int is_volatile = TYPE_VOLATILE (type); - if (is_volatile) - complete_type (type); - int is_complete = COMPLETE_TYPE_P (type); /* Can't load the value if we don't know the type. */ - if (is_volatile && !is_complete) + if (is_volatile && !COMPLETE_TYPE_P (complete_type (type))) { if (complain & tf_warning) switch (implicit) @@ -1298,50 +1295,7 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain) gcc_unreachable (); } } - /* Don't load the value if this is an implicit dereference, or if - the type needs to be handled by ctors/dtors. */ - else if (is_volatile && is_reference) - { - if (complain & tf_warning) - switch (implicit) - { - case ICV_CAST: - warning_at (loc, 0, "conversion to void will not access " - "object of type %qT", type); - break; - case ICV_SECOND_OF_COND: - warning_at (loc, 0, "implicit dereference will not access " - "object of type %qT in second operand of " - "conditional expression", type); - break; - case ICV_THIRD_OF_COND: - warning_at (loc, 0, "implicit dereference will not access " - "object of type %qT in third operand of " - "conditional expression", type); - break; - case ICV_RIGHT_OF_COMMA: - warning_at (loc, 0, "implicit dereference will not access " - "object of type %qT in right operand of " - "comma operator", type); - break; - case ICV_LEFT_OF_COMMA: - warning_at (loc, 0, "implicit dereference will not access " - "object of type %qT in left operand of comma " - "operator", type); - break; - case ICV_STATEMENT: - warning_at (loc, 0, "implicit dereference will not access " - "object of type %qT in statement", type); - break; - case ICV_THIRD_IN_FOR: - warning_at (loc, 0, "implicit dereference will not access " - "object of type %qT in for increment expression", - type); - break; - default: - gcc_unreachable (); - } - } + /* Don't load the value if the type needs to be handled by cdtors. */ else if (is_volatile && TREE_ADDRESSABLE (type)) { if (complain & tf_warning) @@ -1386,7 +1340,7 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain) gcc_unreachable (); } } - if (is_reference || !is_volatile || !is_complete || TREE_ADDRESSABLE (type)) + if (!is_volatile || !COMPLETE_TYPE_P (type)) { /* Emit a warning (if enabled) when the "effect-less" INDIRECT_REF operation is stripped off. Note that we don't warn about @@ -1397,8 +1351,8 @@ convert_to_void (tree expr, impl_conv_void implicit, tsubst_flags_t complain) if (warn_unused_value && implicit != ICV_CAST && (complain & tf_warning) - && !warning_suppressed_p (expr, OPT_Wunused_value) - && !is_reference) + && !warning_suppressed_p (expr, OPT_Wunused_value) + && !REFERENCE_REF_P (expr)) warning_at (loc, OPT_Wunused_value, "value computed is not used"); expr = TREE_OPERAND (expr, 0); if (TREE_CODE (expr) == CALL_EXPR diff --git a/gcc/testsuite/g++.dg/expr/discarded1a.C b/gcc/testsuite/g++.dg/expr/discarded1a.C index 1c4dff4553e..4754f32f716 100644 --- a/gcc/testsuite/g++.dg/expr/discarded1a.C +++ b/gcc/testsuite/g++.dg/expr/discarded1a.C @@ -12,6 +12,5 @@ extern volatile Holder* c; int main() { a; // { dg-message "required from here" } b; // { dg-message "required from here" } - // { dg-warning "implicit dereference will not access object" "" { target *-*-* } .-1 } *c; // { dg-message "required from here" } } diff --git a/gcc/testsuite/g++.dg/expr/volatile2.C b/gcc/testsuite/g++.dg/expr/volatile2.C new file mode 100644 index 00000000000..62e609aee2f --- /dev/null +++ b/gcc/testsuite/g++.dg/expr/volatile2.C @@ -0,0 +1,12 @@ +// Verify we preserve implicit loads of volatile references in a +// discarded-value expression. +// { dg-additional-options "-O -fdump-tree-original -fdump-tree-optimized" } +// { dg-final { scan-tree-dump {\*a} "original" } } +// { dg-final { scan-tree-dump {\*a} "optimized" } } + +struct A { int m; }; +extern volatile A& a; + +int main() { + a; +} diff --git a/gcc/testsuite/g++.old-deja/g++.bugs/900428_01.C b/gcc/testsuite/g++.old-deja/g++.bugs/900428_01.C index a806ef0706e..2b82c64ff73 100644 --- a/gcc/testsuite/g++.old-deja/g++.bugs/900428_01.C +++ b/gcc/testsuite/g++.old-deja/g++.bugs/900428_01.C @@ -46,16 +46,16 @@ void int_test (int i, int *p, volatile int *vp, int &r, volatile int &vr) (void)(i ? r : j); // ok, no warning (void)((void)1, r); // ok, no warning - vr; // { dg-warning "" } reference not accessed - (void)vr; // { dg-warning "" } reference not accessed - (void)(i ? vj : vr); // { dg-warning "" } reference not accessed - (void)(i ? vr : vj); // { dg-warning "" } reference not accessed - (void)((void)1, vr); // { dg-warning "" } reference not accessed + vr; // ok, no warning + (void)vr; // ok, no warning + (void)(i ? vj : vr); // ok, no warning + (void)(i ? vr : vj); // ok, no warning + (void)((void)1, vr); // ok, no warning *ip_fn (); // ok, no warning *vip_fn (); // ok, no warning ir_fn (); // ok, no warning - vir_fn (); // { dg-warning "" } reference not accessed + vir_fn (); // ok, no warning } struct S; @@ -128,16 +128,16 @@ void complete_test (int i, T *p, volatile T *vp, T &r, volatile T &vr) (void)(i ? r : j); // ok, no warning (void)((void)1, r); // ok, no warning - vr; // { dg-warning "" } reference not accessed - (void)vr; // { dg-warning "" } reference not accessed - (void)(i ? vj : vr); // { dg-warning "" } reference not accessed - (void)(i ? vr : vj); // { dg-warning "" } reference not accessed - (void)((void)1, vr); // { dg-warning "" } reference not accessed + vr; // ok, no warning + (void)vr; // ok, no warning + (void)(i ? vj : vr); // ok, no warning + (void)(i ? vr : vj); // ok, no warning + (void)((void)1, vr); // ok, no warning *tp_fn (); // ok, no warning *vtp_fn (); // ok, no warning tr_fn (); // ok, no warning - vtr_fn (); // ok, no warning{ dg-warning "" } reference not accessed + vtr_fn (); // ok, no warning } void extern_test () @@ -160,5 +160,5 @@ void extern_test () esr; // ok, no warning vesr; // { dg-warning "" } incomplete not accessed etr; // ok, no warning - vetr; // { dg-warning "" } reference not accessed + vetr; // ok, no warning }