public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Avoid g++.dg/torture/pr106922.C FAIL with the pre-C++11 ABI
@ 2023-05-10 13:43 Richard Biener
  0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2023-05-10 13:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: jwakely

The following forces the g++.dg/torture/pr106922.C testcase to use
the C++11 libstdc++ ABI and checks if that was successful.

Does this look OK?

Thanks,
Richard.

	* g++.dg/uninit-pr106722-2.C: Force _GLIBCXX_USE_CXX11_ABI to 1.
---
 gcc/testsuite/g++.dg/torture/pr106922.C | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/gcc/testsuite/g++.dg/torture/pr106922.C b/gcc/testsuite/g++.dg/torture/pr106922.C
index 046fc6cce76..4b692d621ea 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 <vector>
 
+// When the library is not dual-ABI and defaults to old just compile
+// and empty TU
+#if _GLIBCXX_USE_CXX11_ABI
+
 #include <optional>
 template <class T>
 using Optional = std::optional<T>;
@@ -46,3 +54,4 @@ void test()
         externals.external2 = internal2;
     }
 }
+#endif
-- 
2.35.3

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-10 13:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-10 13:43 [PATCH] Avoid g++.dg/torture/pr106922.C FAIL with the pre-C++11 ABI Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).