[cfe-commits] [Patch][Review] Tests for explicit conversion operators

Johannes Schaub schaub.johannes at googlemail.com
Sat Jul 23 10:57:42 PDT 2011


Jonathan Sauer wrote:

> Hello,
> 
>> as promised in an earlier mail, I wrote some more tests for C++0x's
>> explicit conversion operators (and found a clang bug along the way,
>> PR10453). I think they are complete now (except for the interaction with
>> constexpr, which is not implemented yet as far as I know).
>> 
...
> Attached is a new patch (which replaces the previous one) which both fixes
> the above bug PR10453 and contains the (updated) test. I ran the clang
> test suite on my local machine, and it passed.
> 
> Please let me know what you think!
> 

I have a comment on these lines:

Y y3 = (Y)z; // expected-error {{no matching conversion for C-style cast 
from 'Conversion::Z' to 'Conversion::Y''}}
Y y4 = Y(z); // expected-error {{no matching conversion for functional-style 
cast from 'Conversion::Z' to 'Conversion::Y'}}
Y y5 = static_cast<Y>(z); // expected-error {{no matching conversion for 
static_cast from 'Conversion::Z' to 'Conversion::Y'}}

I think that these are well-formed according to 13.3.1.4p1. See also 
http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#899 . 

> 
> Jonathan





More information about the cfe-commits mailing list