diff options
Diffstat (limited to 'lib/Edit/RewriteObjCFoundationAPI.cpp')
-rw-r--r-- | lib/Edit/RewriteObjCFoundationAPI.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Edit/RewriteObjCFoundationAPI.cpp b/lib/Edit/RewriteObjCFoundationAPI.cpp index 5f7bef6f54..846d58fc2c 100644 --- a/lib/Edit/RewriteObjCFoundationAPI.cpp +++ b/lib/Edit/RewriteObjCFoundationAPI.cpp @@ -824,8 +824,12 @@ static bool doRewriteToUTF8StringBoxedExpressionHelper( if (Arg->isTypeDependent()) return false; + ASTContext &Ctx = NS.getASTContext(); + const Expr *OrigArg = Arg->IgnoreImpCasts(); QualType OrigTy = OrigArg->getType(); + if (OrigTy->isArrayType()) + OrigTy = Ctx.getArrayDecayedType(OrigTy); if (const StringLiteral * StrE = dyn_cast<StringLiteral>(OrigArg->IgnoreParens())) { @@ -834,8 +838,6 @@ static bool doRewriteToUTF8StringBoxedExpressionHelper( return true; } - ASTContext &Ctx = NS.getASTContext(); - if (const PointerType *PT = OrigTy->getAs<PointerType>()) { QualType PointeeType = PT->getPointeeType(); if (Ctx.hasSameUnqualifiedType(PointeeType, Ctx.CharTy)) { |