aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-05-10 15:36:12 +0200
committerRichard Biener <rguenther@suse.de>2023-05-10 15:49:29 +0200
commita056a9868e6ecab24b0b7e4e12e846097b8c8fb0 (patch)
tree4210fa5c0d90dc49c7771077d36f53fcff7686e6
parent02d79fb228c9f4c7d00dfe09b6ca7ef1392afbec (diff)
downloadgcc-a056a9868e6ecab24b0b7e4e12e846097b8c8fb0.zip
gcc-a056a9868e6ecab24b0b7e4e12e846097b8c8fb0.tar.gz
gcc-a056a9868e6ecab24b0b7e4e12e846097b8c8fb0.tar.bz2
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.
-rw-r--r--gcc/testsuite/g++.dg/torture/pr106922.C9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr106922.C b/gcc/testsuite/g++.dg/torture/pr106922.C
index 046fc6c..b0c1489 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
+// an 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