[clang] [clang] fix classification of a string literal expression used as initializer (PR #101447)
Eli Friedman via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 31 21:35:32 PDT 2024
================
@@ -150,6 +148,12 @@ static Cl::Kinds ClassifyInternal(ASTContext &Ctx, const Expr *E) {
case Expr::OMPIteratorExprClass:
return Cl::CL_LValue;
+ // C++ [expr.prim.general]p1: A string literal is an lvalue.
+ // Except we special case them as prvalues when they are used for
+ // initialization.
----------------
efriedma-quic wrote:
Maybe say more specifically "to initialize a char array".
https://github.com/llvm/llvm-project/pull/101447
More information about the cfe-commits
mailing list