From: Richard Biener Date: Wed, 10 May 2023 13:36:12 +0000 (+0200) Subject: Avoid g++.dg/torture/pr106922.C FAIL with the pre-C++11 ABI X-Git-Tag: basepoints/gcc-15~9481 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a056a9868e6ecab24b0b7e4e12e846097b8c8fb0;p=thirdparty%2Fgcc.git Avoid g++.dg/torture/pr106922.C FAIL with the pre-C++11 ABI The following forces the g++.dg/torture/pr106922.C testcase to use the C++11 libstdc++ ABI and checks whether that worked. gcc/testsuite/ * g++.dg/torture/pr106922.C: Force _GLIBCXX_USE_CXX11_ABI to 1. --- diff --git a/gcc/testsuite/g++.dg/torture/pr106922.C b/gcc/testsuite/g++.dg/torture/pr106922.C index 046fc6cce76a..b0c1489fbdc4 100644 --- a/gcc/testsuite/g++.dg/torture/pr106922.C +++ b/gcc/testsuite/g++.dg/torture/pr106922.C @@ -4,8 +4,16 @@ // -O1 doesn't iterate VN and thus has bogus uninit diagnostics // { dg-skip-if "" { *-*-* } { "-O1" } { "" } } +// The testcase still emits bogus diagnostics with the pre-C++11 ABI +#undef _GLIBCXX_USE_CXX11_ABI +#define _GLIBCXX_USE_CXX11_ABI 1 + #include +// When the library is not dual-ABI and defaults to old just compile +// an empty TU +#if _GLIBCXX_USE_CXX11_ABI + #include template using Optional = std::optional; @@ -46,3 +54,4 @@ void test() externals.external2 = internal2; } } +#endif