Le 09/06/2016 09:53, Jean-Marc Lasgouttes a écrit :
Le 08/06/2016 à 01:30, Guillaume Munch a écrit :
I believe clang is right and gcc is wrong. gcc treats rc as an rvalue,
which makes the conversion into unique_ptr<Revertible> valid. But rc
should not be considered as an rvalue, because the standard only allows
the case when the return type matches the type of the expression (up
to cv-qualifiers).

Hmm, this is way above my head :) But the rule of thumb "clang is
usually right" is usually right.


I have just found that the gcc-5 behaviour is a c++14 feature:
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579

Clang is nevertheless right for C++11.

Reply via email to