Hi Jason,

on the match-and-simplify branch I currently see

And the C++ relying on fold _not_ folding (T) (T) 4B to 4 causes                
                                                                                
FAIL: g++.dg/cpp0x/constexpr-reinterpret1.C  -std=c++11  (test for errors, 
line 
21)                                                                             
FAIL: g++.dg/cpp0x/constexpr-reinterpret1.C  -std=c++1y  (test for errors, 
line 
21)                                                                             
                                                  
Because the C++ FE relies on fold _not_ folding (T&)(T&) 4B to 4.
Which it currently does not because if you ask fold_unary to
fold (T&) of the unfolded tree (T&) 4B then the first transform
that applies (because of accidential(?) ordering in fold_unary) is
the one stripping conversions to an equal type which just returns
the operand, (T&) 4B.  On match-and-simplify no such ordering
takes place and instead we apply the transform of the most complex
pattern we can match - which is optimizing two conversions in a row.
In this case it says the middle conversion is not necessary and
converts it to (T) 4B - re-folding that which folds it to just 4
which is no longer a cast and thus we fail to warn.

I have no idea how I can keep the testcase working - to me it
seems it works by accident.  So I am inclinded to XFAIL it
(it's an accept-invalid then).

Any other ideas?

Thanks,
Richard.

Reply via email to