String literals are always valid LValues.

llvm-svn: 44472
This commit is contained in:
Anders Carlsson 2007-11-30 22:47:59 +00:00
parent c9bcda94ae
commit 7a9a38abe0
1 changed files with 1 additions and 0 deletions

View 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())