[PATCH] Fix fallout from r219557

Anton Korobeynikov anton at korobeynikov.info
Tue Nov 11 12:49:56 PST 2014


Just to make stuff clear.

Currently we're building the following AST:

```
`-FunctionDecl 0x7fc5b306d600 <line:4:1, line:7:1> line:4:5 main 'int (void)'
  `-CompoundStmt 0x7fc5b306d940 <col:16, line:7:1>
    |-ConditionalOperator 0x7fc5b306d8d0 <line:5:3, col:32> '_Complex long double'
    | |-IntegerLiteral 0x7fc5b306d6f8 <col:3> 'int' 0
    | |-CallExpr 0x7fc5b306d7a0 <col:7, col:17> 'long double'
    | | |-ImplicitCastExpr 0x7fc5b306d788 <col:7> 'long double (*)(long double)' <FunctionToPointerDecay>
    | | | `-DeclRefExpr 0x7fc5b306d718 <col:7> 'long double (long double)' Function 0x7fc5b3033e50 'sqrtl' 'long double (long double)'
    | | `-ImplicitCastExpr 0x7fc5b306d7d0 <col:13> 'long double' <FloatingCast>
    | |   `-FloatingLiteral 0x7fc5b306d740 <col:13> 'float' 2.000000e+00
    | `-CallExpr 0x7fc5b306d870 <col:21, col:32> '_Complex long double'
    |   |-ImplicitCastExpr 0x7fc5b306d858 <col:21> '_Complex long double (*)(_Complex long double)' <FunctionToPointerDecay>
    |   | `-DeclRefExpr 0x7fc5b306d7e8 <col:21> '_Complex long double (_Complex long double)' Function 0x7fc5b3033b30 'csqrtl' '_Complex long double (_Complex long double)'
    |   `-ImplicitCastExpr 0x7fc5b306d8b8 <col:28> '_Complex long double' <FloatingRealToComplex>
    |     `-ImplicitCastExpr 0x7fc5b306d8a0 <col:28> 'long double' <FloatingCast>
    |       `-FloatingLiteral 0x7fc5b306d810 <col:28> 'float' 2.000000e+00
    `-ReturnStmt 0x7fc5b306d920 <line:6:3, col:10>
      `-IntegerLiteral 0x7fc5b306d900 <col:10> 'int' 0
```

The type of operator itself is correct. However, the types of lhs and rhs do not match. Prior to r219557 there was additional ImplicitCastExpr to convert the result of sqrtl to _Complex long double.

REPOSITORY
  rL LLVM

http://reviews.llvm.org/D6217






More information about the cfe-commits mailing list