]> granicus.if.org Git - clang/commitdiff
Fix the regression on test/Sema/cfstring.c
authorChris Lattner <sabre@nondot.org>
Sat, 25 Aug 2007 05:30:33 +0000 (05:30 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 25 Aug 2007 05:30:33 +0000 (05:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41396 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaChecking.cpp

index a1deb3d256dd485e6c03e6480903843a90e54c5e..a62c73e8fb76617b7271b064e41599f5b45b8aed 100644 (file)
@@ -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<ParenExpr>(Arg))
-    Arg = PE->getSubExpr();
+bool Sema::CheckBuiltinCFStringArgument(Expr* Arg) {
+  while (1) {
+    if (ParenExpr *PE = dyn_cast<ParenExpr>(Arg))
+      Arg = PE->getSubExpr();
+    else if (ImplicitCastExpr *ICE = dyn_cast<ImplicitCastExpr>(Arg))
+      Arg = ICE->getSubExpr();
+    else
+      break;
+  }
   
   StringLiteral *Literal = dyn_cast<StringLiteral>(Arg);