[cfe-dev] deque<Incomplete Type> support

Dimitry Andric dimitry at andric.com
Tue Nov 12 15:26:18 PST 2013


On 12 Nov 2013, at 23:36, Zhihao Yuan <zy at miator.net> wrote:
> On Tue, Nov 12, 2013 at 3:14 PM, Dimitry Andric <dimitry at andric.com> wrote:
>> 2) In particular, the effects are undefined in the following cases:
> 
> Of course it's undefined, but implement something in a defined way
> does not make an implementation non-confirming.  Otherwise, all
> compilers with well-defined signed overflow behavior are non-confirming.

Sure, but then you are not writing standards-based C++ anymore.  Your
code would only work on specific implementations, which happen to
implement the behavior you expect.


>> The pan program is actually one of the first of many C++ programs in FreeBSD's ports collection that encountered this specific problem, so I don't think this is enough reason to change libc++'s internal implementation details just for it.
> 
> Two months ago one of my crappy program ran into a linker issue with
> libstdc++'s __normal_iterator's operator+.  Of course standard says nothing
> about whether implementation defined iterator types' operator+ can or can not
> odr-use its argument, but they still fixed this.  What does that mean?

That means that libstdc++ authors are flexible, which is nice of them,
and are happy to implement the behavior *you* expect.  Now there might
be a problem when somebody else expects something different. :-)


> Improving QoI is nothing shame.  No matter how many user can benefit from
> it, placing unneeded barrier on harmless issue should not be recommended.
...
> No matter you see an reason or not, an issue like this has been
> identified as bug and being *fixed* before:
> 
>  http://llvm.org/bugs/show_bug.cgi?id=9351

Well, if this can be fixed in a similar way, and Howard thinks it is
worthwhile, I don't see why not.  But personally I would still refrain
from relying on it...

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 203 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131113/0c12a534/attachment.sig>


More information about the cfe-dev mailing list