[gdb/testsuite] Handle gdb.cp/*.exp with older compiler
authorTom de Vries <tdevries@suse.de>
Mon, 28 Aug 2023 11:46:36 +0000 (13:46 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 28 Aug 2023 11:46:36 +0000 (13:46 +0200)
commitc67caa51e47ca301f6d95b34e8d7c89993ba4039
treee4b641ef6fa48e300b506cc191bb807f44c18ce7
parent025e84f93566c8ced594ef48ddee1dec7e5b4cdd
[gdb/testsuite] Handle gdb.cp/*.exp with older compiler

When running test-cases gdb.cp/*.exp with gcc 4.8.4, I run into compilation
failures due to the test-cases requiring c++11 and the compiler defaulting
to less than that.

Fix this by compiling with -std=c++11.

This exposes two FAILs in gdb/testsuite/gdb.cp/empty-enum.exp due to
gcc PR debug/16063, so xfail those.

Also require have_compile_flag -std=c++17 in gdb.cp/constexpr-field.exp to
prevent compilation failure.

Tested on x86_64-linux.
gdb/testsuite/gdb.cp/casts.exp
gdb/testsuite/gdb.cp/constexpr-field.exp
gdb/testsuite/gdb.cp/empty-enum.exp
gdb/testsuite/gdb.cp/koenig.exp
gdb/testsuite/gdb.cp/method-call-in-c.exp
gdb/testsuite/gdb.cp/paramless.exp
gdb/testsuite/gdb.cp/templates.exp
gdb/testsuite/gdb.cp/typed-enum.exp