Boost Testing :
From: Steve Clamage (Stephen.Clamage_at_[hidden])
Date: 2006-07-03 11:44:41
Douglas Gregor wrote:
> On Jul 3, 2006, at 9:43 AM, Jeff Garland wrote:
>> Douglas Gregor wrote:
>>> I'm CC'ing you on this discussion because it looks like a name
>>> mangling bug in the latest Sun C++ compiler. The linker produces
>>> this error message:
>>> ...snip detail...
>>> The problem is that the compiler is putting "const" into the
>>> mangled name for the definition, but it shouldn't be there.
>>> Jeff, it looks like you can work around this bug by removing
>>> "const" from "const int ele" in src/gregorian/date_generators.cpp.
>> Thanks for the analysis Doug. It looks like there is actually a
>> mismatch between the declaration in boost/date_time/
>> date_generators.hpp and the .cpp
>> //! Returns nth arg as string. 1 -> "first", 2 -> "second", max is 5.
>> BOOST_DATE_TIME_DECL const char* nth_as_str(int n);
>> BOOST_DATE_TIME_DECL const char* nth_as_str(const int ele)
>> I'm surprised that's working on any compilers -- looks like the other
>> compilers are being a bit lax on signature matching. I'm fixing now.
> IIRC, top-level cv-qualifiers on argument types are dropped, so I
> believe your code is correct. It just happens to poke at one particular
> corner case.
That's correct. The declarations
void foo(const int);
declare the same function, not different functions. As I explained in
another email, the problem is a Sun compiler bug. If you can make the
declarations the same, the code will link.
--- Steve Clamage, stephen.clamage_at_[hidden]