From 1e7416363963e27c8d122bee2397d4b48a482ec3 Mon Sep 17 00:00:00 2001 From: Bruno Larsen Date: Tue, 4 Oct 2022 16:09:05 +0200 Subject: [PATCH] gdb/testsuite: fix gdb.cp/converts.exp to run with clang Clang attempts to minimize the size of the debug-info by not adding complete information about types that aren't constructed in a given file. Specifically, this meant that there was minimal information about class B in the test gdb.cp/converts.exp. To fix this, we just need to construct any object of type B in that file. Approved-By: Andrew Burgess --- gdb/testsuite/gdb.cp/converts.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.cp/converts.cc b/gdb/testsuite/gdb.cp/converts.cc index ecf806481fd..1224581a879 100644 --- a/gdb/testsuite/gdb.cp/converts.cc +++ b/gdb/testsuite/gdb.cp/converts.cc @@ -55,7 +55,7 @@ int main() char av = 'a'; char *a = &av; // pointer to.. - B *bp; + B *bp = new B(); foo1_1 (a); // ..pointer foo1_2 (a); // ..array foo1_3 ((int*)a); // ..pointer of wrong type -- 2.30.2