Boost logo

Boost :

Subject: Re: [boost] Failures for GCC 4.4.1 with gnu++0x
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-09-06 09:46:04


Bo Persson wrote:
> Steven Watanabe wrote:
>> AMDG
>>
>> Beman Dawes wrote:
...
>>> I missed iostreams. The problem seems to be a bug in gcc. This
>>> program: #include <utility>
>>>
>>> int main()
>>> {
>>> std::pair<int, int*> x(0,0);
>>> return 0;
>>> }
>>>
>>> compiles without -std=gnu++0x, but with -std=gnu++0x gets an error:
>>>
>>> c:\gcc\bin\../lib/gcc/i386-pc-mingw32/4.4.0/../../../../include/c++/4.4.0/bits/stl_pair.h:
>>> In constr
>>> uctor 'std::pair<_T1, _T2>::pair(_U1&&, _U2&&) [with _U1 = int,
>>> _U2 = int, _T1 = int, _T2 = int*]':
>>> cvt-0-to-ptr.cpp:5: instantiated from here
>>> c:\gcc\bin\../lib/gcc/i386-pc-mingw32/4.4.0/../../../../include/c++/4.4.0/bits/stl_pair.h:90:
>>> error:
>>> invalid conversion from 'int' to 'int*'
>>>
>>> I tried to find this in gcc bugzilla, but didn't come up with
>>> anything. Is anyone else have any knowledge of this problem?
>>>
>>
>> This is a result of the addition of a templated constructor for
>> std::pair in C++0x. gcc seems to be behaving correctly.
>>
>
> Yes, but that constructor is (was!) supposed to be constrained by a
> Constructible concept. The compiler correctly points out that the
> parameter fails that concept.
>
> Interesting! .-)

This issue

http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2009/n2940.html#811

is one of those solved by concepts that are now back.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk