From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by sourceware.org (Postfix) with ESMTP id 9B70F3857C65 for ; Mon, 27 Jul 2020 13:09:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9B70F3857C65 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-381-ag3ETJxsOOu1YMpjTZes0Q-1; Mon, 27 Jul 2020 09:09:08 -0400 X-MC-Unique: ag3ETJxsOOu1YMpjTZes0Q-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 68435101C8A5 for ; Mon, 27 Jul 2020 13:09:07 +0000 (UTC) Received: from blade.nx (ovpn-114-184.ams2.redhat.com [10.36.114.184]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B517619C4 for ; Mon, 27 Jul 2020 13:09:07 +0000 (UTC) Received: from blade.com (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id 55377816CCA9 for ; Mon, 27 Jul 2020 14:09:06 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH] Enable gdb.cp/ambiguous.exp with GCC >= 10.1 and clang Date: Mon, 27 Jul 2020 14:09:05 +0100 Message-Id: <1595855345-15492-1-git-send-email-gbenson@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII 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_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: Mon, 27 Jul 2020 13:09:11 -0000 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. 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-*}] } { + unsupported "compiler does not support -Wno-inaccessible-base" + return -1 +} + +set additional_flags "" +if { [test_compiler_info gcc*] } { + || [test_compiler_info clang*] } { + set additional_flags "additional_flags=-Wno-inaccessible-base" +} -if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { +if {[prepare_for_testing "failed to prepare" $testfile $srcfile \ + [list debug c++ $additional_flags]]} { return -1 } -- 1.8.3.1