[cfe-dev] C++ Conditional Operator
    Eli Friedman 
    eli.friedman at gmail.com
       
    Sun Apr 12 16:25:57 PDT 2009
    
    
  
On Sun, Apr 12, 2009 at 2:33 PM, Sebastian Redl
<sebastian.redl at getdesigned.at> wrote:
> I'll implement C++ semantics for ?: over the next few days. Because the
> operator has awful semantics, I've decided to use a test-first approach
> to it. I'd appreciate a review of my test case before I go and implement
> something incorrect.
For the bit-fields, a test like "(i1 ? flds.b1 : flds.b2) = 0;" would be nice.
For the p2 tests, a test that should fail like "1 ? (void)0 : 0;" would be nice.
For the p3 tests, one or two tests with private bases might be useful,
to make sure we're actually finding the right conversion.
I'm not that familiar with the details of the C++ rules, but none of
the tests looks obviously wrong.
-Eli
    
    
More information about the cfe-dev
mailing list