Enable gdb.cp/ambiguous.exp with GCC and clang
authorGary Benson <gbenson@redhat.com>
Tue, 25 Aug 2020 14:14:46 +0000 (15:14 +0100)
committerGary Benson <gbenson@redhat.com>
Tue, 25 Aug 2020 14:14:46 +0000 (15:14 +0100)
commit9f68b4534846660ad07f988815523ce75dc8f78a
tree06d49acf2cc5408eb697b5b74ddb69e54eb9ee0b
parent1ab8d928977f4d9f137f972d03e079555d0f29fa
Enable gdb.cp/ambiguous.exp with GCC and clang

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, building with
-Wno-inaccessible-base when using GCC >= 10.1, and -w otherwise.

gdb/testsuite/ChangeLog:

* gdb.cp/ambiguous.exp: Enable test when compiling with GCC.
Add additional_flags=-Wno-inaccessible-base when compiling
with GCC >= 10.1 or clang.  Add additional_flags=-w when
compiling with GCC < 10.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.cp/ambiguous.exp