[libcxx-commits] [libcxx] [libc++][AIX] Marking the tests UNSUPPORTED as the current implementation of fopen w+bx overrides ios::noreplace (PR #188425)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Mar 25 00:38:05 PDT 2026
https://github.com/Himadhith created https://github.com/llvm/llvm-project/pull/188425
Mode below fails due to `w+bx` overriding the `ios::noreplace`, which clearly states the file should not be opened if it already exists. This is being disregarded causing assertion failure.
```
std::ios_base::in | std::ios_base::out | std::ios_base::trunc | std::ios_base::noreplace |
std::ios_base::binary,
```
>From 2e9a6f695f923d12b7fa59bab03961e312df28a6 Mon Sep 17 00:00:00 2001
From: himadhith <himadhith.v at ibm.com>
Date: Wed, 25 Mar 2026 05:17:26 -0400
Subject: [PATCH] [libc++][AIX] Marking the tests UNSUPPORTED as the current
implementation of fopen w+bx overrides ios::noreplace
---
.../fstreams/filebuf.members/open_pointer.pass.cpp | 3 ++-
.../file.streams/fstreams/fstream.cons/pointer.pass.cpp | 3 ++-
.../fstreams/fstream.members/open_pointer.pass.cpp | 3 ++-
.../file.streams/fstreams/ofstream.cons/pointer.pass.cpp | 3 ++-
.../fstreams/ofstream.members/open_pointer.pass.cpp | 3 ++-
5 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp
index 9f617dc1e5a89..c680f69ca5472 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp
@@ -13,7 +13,8 @@
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
-// XFAIL: LIBCXX-AIX-FIXME
+// fopen() with "w+bx" mode ignores the 'x' (exclusive) flag, allowing existing files to be opened and truncated, breaking C++23 ios_base::noreplace functionality.
+// UNSUPPORTED: target={{.*}}-aix{{.*}}
#include <fstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp
index 2e0ebcd684d79..51aa221938a44 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp
@@ -16,7 +16,8 @@
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
-// XFAIL: LIBCXX-AIX-FIXME
+// fopen() with "w+bx" mode ignores the 'x' (exclusive) flag, allowing existing files to be opened and truncated, breaking C++23 ios_base::noreplace functionality.
+// UNSUPPORTED: target={{.*}}-aix{{.*}}
#include <fstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp
index 0d83d681b1dfc..20954f047a7aa 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp
@@ -16,7 +16,8 @@
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
-// XFAIL: LIBCXX-AIX-FIXME
+// fopen() with "w+bx" mode ignores the 'x' (exclusive) flag, allowing existing files to be opened and truncated, breaking C++23 ios_base::noreplace functionality.
+// UNSUPPORTED: target={{.*}}-aix{{.*}}
#include <fstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
index fbb03f1e85841..86b0bf246cb03 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp
@@ -16,7 +16,8 @@
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
-// XFAIL: LIBCXX-AIX-FIXME
+// fopen() with "w+bx" mode ignores the 'x' (exclusive) flag, allowing existing files to be opened and truncated, breaking C++23 ios_base::noreplace functionality.
+// UNSUPPORTED: target={{.*}}-aix{{.*}}
#include <fstream>
#include <cassert>
diff --git a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp
index 73a474277a933..e91dc452440a5 100644
--- a/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp
+++ b/libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp
@@ -16,7 +16,8 @@
// In C++23 and later, this test requires support for P2467R1 in the dylib (a3f17ba3febbd546f2342ffc780ac93b694fdc8d)
// XFAIL: (!c++03 && !c++11 && !c++14 && !c++17 && !c++20) && using-built-library-before-llvm-18
-// XFAIL: LIBCXX-AIX-FIXME
+// fopen() with "w+bx" mode ignores the 'x' (exclusive) flag, allowing existing files to be opened and truncated, breaking C++23 ios_base::noreplace functionality.
+// UNSUPPORTED: target={{.*}}-aix{{.*}}
#include <fstream>
#include <cassert>
More information about the libcxx-commits
mailing list