バグレポートの英文とパッチ
件の Boost.Wave と Boost.PropertyTree のバグについて、新しい Ticket を投稿すべく、英文とパッチを書いてみた。
何しろ英語力が(ry なので、相当酷いです。
パッチについては、正しく動作することは一応確認しておりますが、こんな感じで良いものかどうか。
- Boost.Wave のバグ報告
-
- boost::multi_index::get function, VC++ compiler cannot lookup
In VC++ compiler, if you included "boost/utility/value_init.hpp" before "boost/wave/util/cpp_include_paths.hpp", as a compilation error. #include <boost/utility/value_init.hpp> #include <boost/wave/util/cpp_include_paths.hpp> The cause, cpp_include_paths.hpp is written in the get function, boost::multi_index::get is not to lookup, despite using directives. I think it should be written explicit using declarations.
---- VC++ コンパイラにおいて、"boost/wave/util/cpp_include_paths.hpp" よりも前に "boost/utility/value_init.hpp" をインクルードしたならば、コンパイルエラーになる。 #include <boost/utility/value_init.hpp> #include <boost/wave/util/cpp_include_paths.hpp> 原因は、cpp_include_paths.hpp で書かれている get 関数が、using ディレクティブにもかかわらず boost::multi_index::get をルックアップしないためである。 私は using 宣言を明示的に記述すべきだと思う。
-
- パッチ (cpp_include_paths.patch)
Index: boost/wave/util/cpp_include_paths.hpp =================================================================== --- boost/wave/util/cpp_include_paths.hpp (revision 69314) +++ boost/wave/util/cpp_include_paths.hpp (working copy) @@ -182,7 +182,7 @@ public: bool has_pragma_once(std::string const &filename) { - using namespace boost::multi_index; + using boost::multi_index::get; return get<from>(pragma_once_files).find(filename) != pragma_once_files.end(); } bool add_pragma_once_header(std::string const &filename, @@ -198,7 +198,7 @@ range_type r = pragma_once_files.get<to>().equal_range(guard_name); if (r.first != r.second) { - using namespace boost::multi_index; + using boost::multi_index::get; get<to>(pragma_once_files).erase(r.first, r.second); return true; }
- Boost.PropertyTree のバグ報告
-
- rapidxml the alloc_func typedef, VC++ compiler cannot parse
In VC++ compiler, if you declared alloc_func type in visible scope from the boost::property_tree::detail::rapidxml namespace before include "boost/property_tree/detail/rapidxml.hpp", as a compilation error. struct alloc_func; #include <boost/property_tree/detail/rapidxml.hpp> The cause, rapidxml.hpp written in the typedef for alloc_func, VC + + compiler is unable to parse.
---- VC++ コンパイラにおいて、"boost/property_tree/detail/rapidxml.hpp" をインクルードするより前に "boost::property_tree::detail::rapidxml" 名前空間から見えるスコープに alloc_func という型名が宣言されていると、コンパイルエラーになる。 struct alloc_func; #include <boost/property_tree/detail/rapidxml.hpp> 原因は、rapidxml.hpp で書かれている alloc_func の typedef を、VC++ コンパイラが解析できないためである。
-
- パッチ (rapidxml.patch)
Index: boost/property_tree/detail/rapidxml.hpp =================================================================== --- boost/property_tree/detail/rapidxml.hpp (revision 69314) +++ boost/property_tree/detail/rapidxml.hpp (working copy) @@ -16,6 +16,11 @@ #include <cstdlib> // For std::size_t #include <new> // For placement new +#ifdef _MSC_VER +#include <boost/config.hpp> // For BOOST_DEDUCED_TYPENAME +#include <boost/mpl/identity.hpp> +#endif + // On MSVC, disable "conditional expression is constant" warning (level 4). // This warning is almost impossible to avoid with certain types of templated code #ifdef _MSC_VER @@ -367,7 +372,11 @@ public: //! \cond internal +#ifdef _MSC_VER + typedef BOOST_DEDUCED_TYPENAME mpl::identity<void *>::type (alloc_func)(std::size_t); +#else typedef void *(alloc_func)(std::size_t); // Type of user-defined function used to allocate memory +#endif typedef void (free_func)(void *); // Type of user-defined function used to free memory //! \endcond