Boost logo

Proto :

Subject: Re: [proto] Proto v5
From: Eric Niebler (eric_at_[hidden])
Date: 2013-06-15 21:59:52


On 13-06-15 03:40 PM, Agustín K-ballo Bergé wrote:
> On 15/06/2013 03:43 a.m., Agustín K-ballo Bergé wrote:
>> On 14/06/2013 11:06 p.m., Eric Niebler wrote:
>>>
>>> (Sorry for the top-posting. I'm away from my computer.)
>>>
>>> The repository *is* compilable, if your compiler is clang built from
>>> trunk. I suspect there are bugs in Proto, gcc, and clang, and sorting
>>> it all out will be fun.
>>>
>>> Thanks for your patch. I'll apply it as soon as I can.
>>>
>>> Eric
>>
>> That's the green light I was expecting to start picking Proto v5 at GCC.
>> I just got the first test compiling and passing successfully
>> (action.cpp). I have pushed all the changes to my fork of the
>> repository, so if you are interested keep an eye on it.
>>
>> Even after disabling the substitution_failure machinery (to get the full
>> instantiation spew), going through the compiler output is mind
>> bending... My respects to you, sir!
>>
>>>
>
> The fork of Proto v5 at https://github.com/K-ballo/proto-0x correctly
> compiles and passes (almost*) all test cases and examples with GCC
> 4.8.1.

Wow! This is huge.

> There are two caveats:
>
> - GCC does not allow the use of `this` within noexcept specifications,
> so those are disabled. This is a bug in GCC (reported by Dave Abrahams
> here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52869)

Thanks. There is also this one that I filed (and I see you worked around
with mpl::identity): http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57384

> - 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.

> This,
> in turn, means that non-const rvalues (?) cannot be used in constant
> expressions since constexpr implies const (in C++11, not anymore in
> C++14). Anyway, this is more than I can digest at the moment.
>
> (*) the bit failing to compile is a use of Proto actions as a constant
> expression [the `omg` case at everywhere.cpp], due to the issue with
> ref-qualifier overloads.

I see you included all of these fixes in your one pull request. I'll
need to go through this carefully and file compiler bugs where
necessary. I also want to use BOOST_WORKAROUND if we actually include
any temporary workarounds in the code. I say "temporary" because I have
every intention of ripping out all workarounds once the bugs actually
get fixed. I intend to keep this code as clean as possible.

A million thanks for your work. It's a huge help.

-- 
Eric Niebler
BoostPro Computing
www.boostpro.com



Proto list run by eric at boostpro.com