From: Chris Lattner Date: Sat, 25 Aug 2007 05:30:33 +0000 (+0000) Subject: Fix the regression on test/Sema/cfstring.c X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cc6f65d9f210efc56d7418753e93bf5a14f3ac59;p=clang Fix the regression on test/Sema/cfstring.c git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41396 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/Sema/SemaChecking.cpp b/Sema/SemaChecking.cpp index a1deb3d256..a62c73e8fb 100644 --- a/Sema/SemaChecking.cpp +++ b/Sema/SemaChecking.cpp @@ -80,10 +80,15 @@ Sema::CheckFunctionCall(Expr *Fn, /// CheckBuiltinCFStringArgument - Checks that the argument to the builtin /// CFString constructor is correct -bool Sema::CheckBuiltinCFStringArgument(Expr* Arg) -{ - while (ParenExpr *PE = dyn_cast(Arg)) - Arg = PE->getSubExpr(); +bool Sema::CheckBuiltinCFStringArgument(Expr* Arg) { + while (1) { + if (ParenExpr *PE = dyn_cast(Arg)) + Arg = PE->getSubExpr(); + else if (ImplicitCastExpr *ICE = dyn_cast(Arg)) + Arg = ICE->getSubExpr(); + else + break; + } StringLiteral *Literal = dyn_cast(Arg);