[Bug libstdc++/55713] std::tupleElementType incorrectly is convertible to ElementType when it is an empty class

2012-12-16 Thread pinskia at gcc dot gnu.org


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



--- Comment #1 from Andrew Pinski pinskia at gcc dot gnu.org 2012-12-16 
17:49:20 UTC ---

This was done for an optimization. And I think it is allowed by the C++

standard too.


[Bug libstdc++/55713] std::tupleElementType incorrectly is convertible to ElementType when it is an empty class

2012-12-16 Thread schaub.johannes at googlemail dot com


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



--- Comment #2 from Johannes Schaub schaub.johannes at googlemail dot com 
2012-12-16 17:52:14 UTC ---

(In reply to comment #1)

 This was done for an optimization. And I think it is allowed by the C++

 standard too.



From the feedback I received from Stackoverflow (

http://stackoverflow.com/q/13902910/34509 ) I assumed that this behavior is not

permissible. There also appear to be ways to make it not behave that way (see

LLVM libc++'s implementation).


[Bug libstdc++/55713] std::tupleElementType incorrectly is convertible to ElementType when it is an empty class

2012-12-16 Thread redi at gcc dot gnu.org


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



Jonathan Wakely redi at gcc dot gnu.org changed:



   What|Removed |Added



   Keywords||rejects-valid

 Status|UNCONFIRMED |NEW

   Last reconfirmed||2012-12-16

 Ever Confirmed|0   |1



--- Comment #3 from Jonathan Wakely redi at gcc dot gnu.org 2012-12-16 
20:39:51 UTC ---

What stackoverflow says is not gospel, but I agree this should compile.



The summary is misleading, it's not convertible, because the base class is

inaccessible.


[Bug libstdc++/55713] std::tupleElementType incorrectly is convertible to ElementType when it is an empty class

2012-12-16 Thread glisse at gcc dot gnu.org


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



Marc Glisse glisse at gcc dot gnu.org changed:



   What|Removed |Added



 CC||glisse at gcc dot gnu.org



--- Comment #4 from Marc Glisse glisse at gcc dot gnu.org 2012-12-16 22:47:34 
UTC ---

libc++'s implementation has the drawback that a tuple of empty types is not

empty (at least with the current ABI).



It seems a shame that sfinae now manages to handle access control cleverly

enough to disable overloads but regular code still handles access control as

something that is only checked after the fact.