Files
clang-p2996/clang/lib/CodeGen/CGExprConstant.cpp
Nick Desaulniers d1199808af [clang][ConstExprEmitter] handle ArrayToPointerDecay ImplicitCastExpr of StringLiterals
Consider the following statement:
    const char* foo = "foo";

For the sub-AST:
    `-ImplicitCastExpr <col:19> 'const char *' <NoOp>
      `-ImplicitCastExpr <col:19> 'char *' <ArrayToPointerDecay>
        `-StringLiteral <col:19> 'char[4]' lvalue "foo"

The address of the StringLiteral can be emitted as the Constant.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D156185
2023-07-25 15:27:08 -07:00

87 KiB