Boost logo

Boost Testing :

From: Boris Gubenko (Boris.Gubenko_at_[hidden])
Date: 2007-02-17 13:14:21


John Maddock wrote:
> If that's the diagnosis then it sounds like a bug in our code to me:
> surely
> map would expect a complete type? The std is a little vague here I admit,
> just specifying that the type must be copy-constructable and assignable:
> but that implies complete to me :-)

The standard says: "the effects are undefined", so, the code does not
violate the standard, it just relies on undefined behaviour:

17.4.3.6 - Other functions [lib.res.on.functions]

-2- In particular, the effects are undefined in the following cases:
...
    o if an incomplete type (basic.types) is used as a template argument
      when instantiating a template component.

And, as Jeff said, all other implementations of STL allow this usage.
Below is a complete :-) minimal reproducer. It complies cleanly with:
Gnu libstdc++, STLport, Dinkumware and Rogue Wave pre-V2.2. It does not
compile with RW 2.2 and higher, which includes Apache stdcxx.

        #include <map>
        struct S {
          std::map<char, S> m;
        };

Thanks,
  Boris

----- Original Message -----
From: "John Maddock" <john_at_[hidden]>
To: "Boris Gubenko" <Boris.Gubenko_at_[hidden]>; "Running Boost regression tests"
<boost-testing_at_[hidden]>
Cc: "Boris Gubenko" <Boris.Gubenko_at_[hidden]>
Sent: Saturday, February 17, 2007 4:47 AM
Subject: Re: [Boost-testing] [date_time] marking tests as
expectedfailuresonHP-UX/aCC

> Boris Gubenko wrote:
>> Jeff Garland wrote:
>>> Sorry to be slow...
>>
>> No problem, thanks for the response.
>>
>>> Do you have exact text you want in the markup...if that's what you're
>>> asking for?
>>
>> This is the text I'd suggest, feel free to modify it as you see fit:
>>
>> "These tests rely on the ability of STL to instantiate map container
>> on an incomplete type. The Rogue Wave library version 2.2 and higher
>> does not allow this."
>
> If that's the diagnosis then it sounds like a bug in our code to me: surely
> map would expect a complete type? The std is a little vague here I admit,
> just specifying that the type must be copy-constructable and assignable: but
> that implies complete to me :-)
>
> John.
>
> _______________________________________________
> Boost-Testing mailing list
> Boost-Testing_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-testing
>
>


Boost-testing list run by mbergal at meta-comm.com