[Bug libstdc++/35480] Relational operators for <tr1/tuple> don't error on different sized tuples

pcarlini at suse dot de gcc-bugzilla@gcc.gnu.org
Thu Mar 6 16:53:00 GMT 2008



------- Comment #4 from pcarlini at suse dot de  2008-03-06 16:53 -------
(In reply to comment #3)
> To me, if get<i>(t) fails to compile under the assumption of "ill formed", then
> by the definitions of 6.1.3.5, get<i>(t) == get<i>(u) should also fail to
> compile. Although it is not explicitly stated in N1836=05-0096.

My exact point was that all the wording about get etc belongs to a **Requires**
clause, which is a *precondition*. In other terms, nothing says that the
implementation actually attempts those operations.

> On an aside, it would certainly be useless to have something compile and run
> with no side effects (as it does) when the construct is clearly erroneous.

Sure. But note that this problem also exists in O(10000) other places in the
Standard, in particular with templates (when there are substantive hopes to
finally catch a bit more at compile-time in C++0x) but also without templates.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35480



More information about the Gcc-bugs mailing list