From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by sourceware.org (Postfix) with ESMTPS id 6855D383E811 for ; Fri, 7 Aug 2020 15:27:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6855D383E811 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=alves.ped@gmail.com Received: by mail-wr1-f67.google.com with SMTP id r2so2037545wrs.8 for ; Fri, 07 Aug 2020 08:27:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PkTzHh6gKYBpwGREy42wf3RU6yEBMUN//SRjsyurhlM=; b=hIsblu05SWbzWVKMxxufUZW3It4XH2FLp9/BFmenOC3J/fG++dMbX0SI/GcZ9L0axA 9+JqlCzlIafc/aVwANncGCjDVmKmbFoTSkWJP4f+RA6MdMj5sSE7yeJOruXLGb0wE9DD xX4KiTdtbKLDiCRYVFVTpscKxdx3atjmb8QHCJJYRw7N9By9ONP9H9Pyvk8tF7a3gFJV JZ/ucDWS0MHOldWPc8VeDQXEjTrwO36p61WT1lx5+Eh9XtCEtcJ2ay4nNL3h+fFz8x+U YShGMN49yKNf7m/y8a6aCJ7EdCLTTQIVrFBbzSJ6edSWLtHs9MmIsDNcPO38j5DTrXcf 87YQ== X-Gm-Message-State: AOAM5302MATfEWPfkHEU5XgOtXTBV2HYnc22E3s60Iv1BbUjGZcrNQkY QOKuL6DgTyltxkaT20SBqoXLbNnuK6Q= X-Google-Smtp-Source: ABdhPJyzA78mXtNugU51VluMnGdPt+rX4KsbjHvaHR5BMWe1Q7M5fqNNHua7x1iKVeJ8ibvhjuRBFQ== X-Received: by 2002:adf:ec04:: with SMTP id x4mr11926041wrn.28.1596814055823; Fri, 07 Aug 2020 08:27:35 -0700 (PDT) Received: from ?IPv6:2001:8a0:f91a:c400:56ee:75ff:fe8d:232b? ([2001:8a0:f91a:c400:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id o2sm11664308wrh.70.2020.08.07.08.27.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Aug 2020 08:27:34 -0700 (PDT) Subject: Re: [PATCH] Enable gdb.cp/ambiguous.exp with GCC >= 10.1 and clang To: Gary Benson , gdb-patches@sourceware.org References: <1595855345-15492-1-git-send-email-gbenson@redhat.com> From: Pedro Alves Message-ID: Date: Fri, 7 Aug 2020 16:27:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1595855345-15492-1-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, 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: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 07 Aug 2020 15:27:40 -0000 On 7/27/20 2:09 PM, Gary Benson via Gdb-patches wrote: > Hi all, > > gdb.cp/ambiguous.exp failed to build using clang with the following > error: > > gdb compile failed, /gdbtest/src/gdb/testsuite/gdb.cp/ambiguous.cc:70:36: > warning: direct base 'A1' is inaccessible due to ambiguity: > class JVA1 -> class KV -> class A1 > class JVA1 -> class A1 [-Winaccessible-base] > class JVA1 : public KV, public LV, public A1 { > ^~~~~~~~~ > > This commit builds this testcase with -Wno-inaccessible-base when > using clang, to avoid this failure. > > Furthermore, gdb.cp/ambiguous.exp has been disabled when using GCC > since 1998. Curious you reference the year, do you know it because you found the commit that disabled it? > This commit enables this testcase when compiling with > GCC >= 10.1, the first version with -Wno-inaccessible-base. > > Checked on Fedora 31 x86_64, GCC and clang. Ok to commit? > > Cheers, > Gary > > -- > gdb/testsuite/ChangeLog: > > * gdb.cp/ambiguous.exp: Enable test when compiling with GCC >= > 10.1. Add additional_flags=-Wno-inaccessible-base when compiling > with GCC or clang. > --- > gdb/testsuite/ChangeLog | 6 ++++++ > gdb/testsuite/gdb.cp/ambiguous.exp | 17 +++++++++++++++-- > 2 files changed, 21 insertions(+), 2 deletions(-) > > diff --git a/gdb/testsuite/gdb.cp/ambiguous.exp b/gdb/testsuite/gdb.cp/ambiguous.exp > index fffe20a..26f96a9 100644 > --- a/gdb/testsuite/gdb.cp/ambiguous.exp > +++ b/gdb/testsuite/gdb.cp/ambiguous.exp > @@ -30,12 +30,25 @@ if { [skip_cplus_tests] } { continue } > standard_testfile .cc > > if [get_compiler_info "c++"] { > + unsupported "couldn't find a valid c++ compiler" > return -1 > } > > -if { [test_compiler_info gcc-*] } then { continue } > +# GCCs prior to 10.1 do not support -Wno-inaccessible-base. > +if { [test_compiler_info {gcc-[0-9]-*}] > + || [test_compiler_info {gcc-10-0-*}] } { Given the first release of GCC 10 is 10.1, do we really need the second check? > + unsupported "compiler does not support -Wno-inaccessible-base" How about instead of bailing out, use "-Wno-inaccessible-base" with GCC >= 10, and use "-w" with older GCCs?