Files
clang-p2996/clang/lib/CodeGen/CGExprConstant.cpp
Nick Desaulniers 2c26397f76 [clang][ConstExprEmitter] handle NullToPointer ImplicitCastExpr
Consider the following statement:
    void* foo = ((void *)0);

For the sub-AST:
    | `-ImplicitCastExpr 'const void *' <NullToPointer>
    |   `-CStyleCastExpr 'void *' <NullToPointer>
    |     `-IntegerLiteral 'int' 0

If the subexpression of the cast is itself the NULL constant, then
ImplicitCastExpr should emit the NULL pointer constant.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D156175
2023-07-26 12:53:02 -07:00

87 KiB