Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#3008 closed Patches (fixed)

Patch for Filesystem / gcc-4.4.0

Reported by: Kevin Sopp Owned by: Beman Dawes
Milestone: Component: filesystem
Version: Boost Development Trunk Severity: Showstopper
Keywords: Cc:

Description

The Filesystem library fails to compile with gcc-4.4.0:

gcc.compile.c++ ../../../bin.v2/libs/filesystem/build/gcc-4.4.0/debug/operations.o In file included from ../../../libs/filesystem/src/operations.cpp:46: /usr/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/tr1_impl/type_traits: In function ‘bool boost::filesystem::is_empty(const boost::filesystem::path&)’: /usr/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/tr1_impl/type_traits:326: error: ‘template<class _Tp> struct std::is_empty’ is not a function, ../../../boost/filesystem/operations.hpp:363: error: conflict with ‘template<class Path> typename boost::enable_if<boost::filesystem::is_basic_path<Path>, bool>::type boost::filesystem::is_empty(const Path&)’ ../../../boost/filesystem/operations.hpp:662: error: in call to ‘is_empty’ /usr/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/tr1_impl/type_traits: In function ‘bool boost::filesystem::is_empty(const boost::filesystem::wpath&)’: /usr/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/tr1_impl/type_traits:326: error: ‘template<class _Tp> struct std::is_empty’ is not a function, ../../../boost/filesystem/operations.hpp:363: error: conflict with ‘template<class Path> typename boost::enable_if<boost::filesystem::is_basic_path<Path>, bool>::type boost::filesystem::is_empty(const Path&)’ ../../../boost/filesystem/operations.hpp:664: error: in call to ‘is_empty’

An easy solution is to fully qualify the function name as this patch does.

It might be necessary to fully qualify other similar function calls as well (is_other, is_symlink, ...), as they might conflict in the same way with user defined class templates, I haven't investigated that though.

I also had to modify test/path_test.cpp, the calls to next/prior were ambiguous with the new std::next/std::prior.

Tests now pass successfully using gcc-4.4.0 in c++0x mode.

Attachments (1)

fs_gcc44.patch (8.7 KB ) - added by anonymous 13 years ago.

Download all attachments as: .zip

Change History (3)

by anonymous, 13 years ago

Attachment: fs_gcc44.patch added

comment:1 by Beman Dawes, 13 years ago

Resolution: fixed
Status: newclosed

(In [52922]) Filesystem: fix #3008, improving namespace discipline to avoid naming conflicts with the C++0x std library.

comment:2 by anonymous, 13 years ago

Many thanks! Supplying a patch file really helps!

--Beman

Note: See TracTickets for help on using tickets.