Skip to content
Commit 769333ae authored by Nick Desaulniers's avatar Nick Desaulniers
Browse files

[clang][CGExprConstant] handle unary negation on integrals

Consider the statement:
    int x = -1;
And the following AST:
    `-VarDecl 0x55c4823a7670 <x.c:2:1, col:10> col:5 x 'int' cinit
      `-UnaryOperator 0x55c4823a7740 <col:9, col:10> 'int' prefix '-'
        `-IntegerLiteral 0x55c4823a7720 <col:10> 'int' 1

Return the evaluation of the subexpression negated.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D156378
parent f6ba3529
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment