summaryrefslogtreecommitdiffstats
path: root/clang/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-08-25 05:30:33 +0000
committerChris Lattner <sabre@nondot.org>2007-08-25 05:30:33 +0000
commit9449fd7bc35f4a0eaa2b6b4171c1eec858c89c01 (patch)
tree45de5823dd3cda2af5df1aa052fd5d472942a865 /clang/Sema/SemaChecking.cpp
parenta206358bb68128a3d396e10c33789ee41deb9db0 (diff)
downloadbcm5719-llvm-9449fd7bc35f4a0eaa2b6b4171c1eec858c89c01.tar.gz
bcm5719-llvm-9449fd7bc35f4a0eaa2b6b4171c1eec858c89c01.zip
Fix the regression on test/Sema/cfstring.c
llvm-svn: 41396
Diffstat (limited to 'clang/Sema/SemaChecking.cpp')
-rw-r--r--clang/Sema/SemaChecking.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/Sema/SemaChecking.cpp b/clang/Sema/SemaChecking.cpp
index a1deb3d256d..a62c73e8fb7 100644
--- a/clang/Sema/SemaChecking.cpp
+++ b/clang/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<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);
OpenPOWER on IntegriCloud