From 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 20:24:20 +0200 Subject: Adding upstream version 14.2.21. Signed-off-by: Daniel Baumann --- .../test/issues/6638-global-init-fails-3.cpp | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/boost/libs/filesystem/test/issues/6638-global-init-fails-3.cpp (limited to 'src/boost/libs/filesystem/test/issues/6638-global-init-fails-3.cpp') diff --git a/src/boost/libs/filesystem/test/issues/6638-global-init-fails-3.cpp b/src/boost/libs/filesystem/test/issues/6638-global-init-fails-3.cpp new file mode 100644 index 00000000..b0a62ede --- /dev/null +++ b/src/boost/libs/filesystem/test/issues/6638-global-init-fails-3.cpp @@ -0,0 +1,36 @@ +#include +#include +#include + +using namespace boost::filesystem; + +// The original bug report was that this broke: +// path p(L"C:\\TEMP\\"); +// path r(p / "narrow"); +// That code now works, but ... + +// Nils Gladitz has provided this example ... + +class Test +{ +public: + ~Test() + { + path p(L"C:\\TEMP\\"); + path r(p / "narrow"); + } +}; + +// path p("narrow"); + +// fails if static linked and Test object is global variable, but does not fail if +// path p("narrow") line above is not commented out, and also does not fail if the +// Test test2 line below is commented out. + +Test test1; +Test test2; + +int cpp_main(int, char* []) +{ + return 0; +} -- cgit v1.2.3