On 6/16/2013 11:59 AM, Agustín K-ballo Bergé wrote:
> On 15/06/2013 10:59 p.m., Eric Niebler wrote:
>>> >- Some specific uses of Proto actions in constant expressions fail. GCC
>>> >reports an ambiguity with ref-qualifiers in the following scenario:
>>> >
>>> >     struct foo
>>> >     {
>>> >         int& bar() &
>>> >         { return _bar; }
>>> >         //~ int&& bar() &&
>>> >         //~ { return static_cast<int&&>(_bar); }
>>> >         constexpr int const& bar() const &
>>> >         { return _bar; }
>>> >         constexpr int const&& bar() const &&
>>> >         { return static_cast<int const&&>(_bar); }
>>> >
>>> >         int _bar;
>>> >     };
>>> >
>>> >     foo().bar();
>>> >
>>> >   For that to work correctly, the 4 overloads need to be provided.
>> Huh. According to the standard, or according to gcc? I won't work around
>> a bug in a compiler without filing it first.
>>
> 
> I got a thorough explanation on the subject from this SO question:
> http://stackoverflow.com/questions/17130607/overload-resolution-with-ref-qualifiers
> . The answer confirms this is a GCC bug, and hints to a "better
> workaround" that would retain constexpr functionality. I may pursue this
> alternative workaround if I ever get to play with the constexpr side of
> Proto v5 (that is, if I use it in a place other than next to an `omg` or
> `srsly` identifier :P).
> 
> Another GCC bug (as far as I understand) is that instantiations within
> template arguments to a template alias are completely ignored when the
> aliased type does not depend on those, thus breaking SFINAE rules. I
> have attached a small code sample that reproduces this issue.

Thanks for your research. When I get a chance, I'll check gcc's bugzilla
to see if they have been filed already, unless you beat me to it.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com
_______________________________________________
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto

Reply via email to