]> granicus.if.org Git - clang/commitdiff
String literals are always valid LValues.
authorAnders Carlsson <andersca@mac.com>
Fri, 30 Nov 2007 22:47:59 +0000 (22:47 +0000)
committerAnders Carlsson <andersca@mac.com>
Fri, 30 Nov 2007 22:47:59 +0000 (22:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44472 91177308-0d34-0410-b5e6-96231b3b80d8

AST/Expr.cpp

index 0aee702c65d596dce239212f15a884b3632bace1..15fbb24a0d4198d4a9bc42b9ee4b500dcb2b58c8 100644 (file)
@@ -296,6 +296,7 @@ Expr::isLvalueResult Expr::isLvalue() const {
   // the type looks fine, now check the expression
   switch (getStmtClass()) {
   case StringLiteralClass: // C99 6.5.1p4
+    return LV_Valid;
   case ArraySubscriptExprClass: // C99 6.5.3p4 (e1[e2] == (*((e1)+(e2))))
     // For vectors, make sure base is an lvalue (i.e. not a function call).
     if (cast<ArraySubscriptExpr>(this)->getBase()->getType()->isVectorType())