[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:39 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Himadhith

<details>
<summary>Changes</summary>

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,
```

---
Full diff: https://github.com/llvm/llvm-project/pull/188425.diff


5 Files Affected:

- (modified) libcxx/test/std/input.output/file.streams/fstreams/filebuf.members/open_pointer.pass.cpp (+2-1) 
- (modified) libcxx/test/std/input.output/file.streams/fstreams/fstream.cons/pointer.pass.cpp (+2-1) 
- (modified) libcxx/test/std/input.output/file.streams/fstreams/fstream.members/open_pointer.pass.cpp (+2-1) 
- (modified) libcxx/test/std/input.output/file.streams/fstreams/ofstream.cons/pointer.pass.cpp (+2-1) 
- (modified) libcxx/test/std/input.output/file.streams/fstreams/ofstream.members/open_pointer.pass.cpp (+2-1) 


``````````diff
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>

``````````

</details>


https://github.com/llvm/llvm-project/pull/188425


More information about the libcxx-commits mailing list