diff options
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; +} |