Subject: [boost] [Boost-Test] Patch xml_log_formatter.hpp for sun-5.9 on Linux
From: K. Noel Belcourt (kbelco_at_[hidden])
Date: 2008-09-08 14:43:11
Attached is a patch to fix this problem with Boost.test trunk and
sun-5.9 on Linux.
"../../../boost/test/impl/unit_test_main.ipp", line 115: Error: Could
not find a match for
boost::unit_test::ut_detail::default_char_compare<char>>) needed in
"../../../boost/test/impl/unit_test_main.ipp", line 115: Error:
Formal argument x of type const
being passed int.
2 Error(s) detected.
"/home/sntools/extras/compilers/studio12/sunstudio12/bin/CC" +d -
g -DBOOST_ALL_NO_LIB=1 -I"../../.." -c -o "../../../bin.v2/libs/test/
The patch adds a using declaration to bring the base class function
into the overload set.
Sun's interpretation of the standard seems to be correct, from what I
can tell. Here's their rational:
[ from their sun-5.9 FAQ ]
Q. Why does the compiler say that a derived-class virtual function
hides a base-class virtual function with a different signature? My
other compiler doesn't complain about the code.
A. The C++ rule is that overloading occurs only within one scope,
never across scopes. A base class is considered to be in a scope that
surrounds the scope of a derived class. Any name declared in a
derived class therefore hides, and cannot overload, any function in a
base class. This fundamental C++ rule predates the ARM.
If another compiler does not complain, it is doing you a disservice,
because the code will not behave as you probably expect. Our compiler
issues a warning while accepting the code. (The code is legal, but
probably does not do what you want.)
If you wish to include base-class functions in an overloaded set, you
must do something to bring the base-class functions into the current
scope. If you are compiling in default standard mode, you can add a
Okay to commit to trunk?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk