[cfe-commits] r41396 - /cfe/trunk/Sema/SemaChecking.cpp
Chris Lattner
sabre at nondot.org
Fri Aug 24 22:30:33 PDT 2007
Author: lattner
Date: Sat Aug 25 00:30:33 2007
New Revision: 41396
URL: http://llvm.org/viewvc/llvm-project?rev=41396&view=rev
Log:
Fix the regression on test/Sema/cfstring.c
Modified:
cfe/trunk/Sema/SemaChecking.cpp
Modified: cfe/trunk/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaChecking.cpp?rev=41396&r1=41395&r2=41396&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/Sema/SemaChecking.cpp Sat Aug 25 00:30:33 2007
@@ -80,10 +80,15 @@
/// 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);
More information about the cfe-commits
mailing list