diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/libs/filesystem/test/issues/6638-global-init-fails-3.cpp | |
parent | Initial commit. (diff) | |
download | ceph-upstream.tar.xz ceph-upstream.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/libs/filesystem/test/issues/6638-global-init-fails-3.cpp')
-rw-r--r-- | src/boost/libs/filesystem/test/issues/6638-global-init-fails-3.cpp | 36 |
1 files changed, 36 insertions, 0 deletions
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 <boost/filesystem.hpp> +#include <boost/detail/lightweight_main.hpp> +#include <string> + +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; +} |