[C++-sig] Re: const_argument test failures
David Abrahams
dave at boost-consulting.com
Tue Oct 19 19:51:10 CEST 2004
Jonathan Brandmeyer wrote:
> On Mon, 2004-10-18 at 17:51, Aleksey Gurtovoy wrote:
>
>>The comment in the test says:
>>
>> * The purpose of this test is to determine if a function can be called from
>> * Python with a const value type as an argument, and whether or not the
>> * presence of a prototype without the cv-qualifier will work around the
>> * compiler's bug.
>>
>>So, OK, the first part of it fails on MSVC < 7.1, naturally, due to the same
>>bug that makes the following to fail:
>>
>> template< typename T > void f(void (*)(T));
>> void g(int const);
>>
>> int main()
>> {
>> f(g); // error C2664: 'f' : cannot convert parameter 1 from
>> // 'void (const int)' to 'void (__cdecl *)(int)'
>>
>> return 0;
>> }
>>
>>The second part of the test "passes", but of course we'll never see it in
>>the reports.
>>
>>So, the question is: what exactly was the original plan for this in terms
>>of its presence in the regression reports?
>
>
> The "plan" was to see which compilers were affected by this bug. It was
> motivated by the thread "Slice test fails on Intel 8.1 at runtime" which
> ran from 9/25 to 9/27. When this test was originally added all versions
> of MSVC and some (all?) versions of intel-win32 were affected. MSVC 7.0
> and newer would fail at runtime in the same way that vc7 is failing now,
> and < 7.0 would fail at compile time. At least one platform (icc 8.1 on
> win32) had no source-level workaround at all that I knew of. Apparently
> something has changed since then since these toolchains are passing now.
This compiler bug should have been worked around on
every platform that has partial specialization (the test passes for me
with vc7.1), and it can be made to work on VC6/7 with
BOOST_TT_BROKEN_COMPILER_SPEC( object )
It's not entirely clear whether we should put that in to make the test
pass on vc6/7, but I am surprised that this test is causing any issue at
this point.
--
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com
More information about the Cplusplus-sig
mailing list