summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-04-02 23:48:59 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-04-02 23:48:59 +0000
commit896ae920d593bb96fad961f7594c68a5362316b0 (patch)
tree005868f2c751ca518fff05dee09eb76ec9df6618 /clang/lib/Parse/ParseExpr.cpp
parent235af9c1f53a34df90a0fd8ffad36976fccd487f (diff)
downloadbcm5719-llvm-896ae920d593bb96fad961f7594c68a5362316b0.tar.gz
bcm5719-llvm-896ae920d593bb96fad961f7594c68a5362316b0.zip
Objective-C arc [qui]. Don't issue the bridge cast
warning when doing a __bride cast in non-arc mode (which has no retain count effect). // rdar://13514210 llvm-svn: 178592
Diffstat (limited to 'clang/lib/Parse/ParseExpr.cpp')
-rw-r--r--clang/lib/Parse/ParseExpr.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/clang/lib/Parse/ParseExpr.cpp b/clang/lib/Parse/ParseExpr.cpp
index 4bb2bf2eba6..956ba36d3c8 100644
--- a/clang/lib/Parse/ParseExpr.cpp
+++ b/clang/lib/Parse/ParseExpr.cpp
@@ -1961,12 +1961,16 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
Tok.is(tok::kw___bridge_retained) ||
Tok.is(tok::kw___bridge_retain)));
if (BridgeCast && !getLangOpts().ObjCAutoRefCount) {
- StringRef BridgeCastName = Tok.getName();
- SourceLocation BridgeKeywordLoc = ConsumeToken();
- if (!PP.getSourceManager().isInSystemHeader(BridgeKeywordLoc))
- Diag(BridgeKeywordLoc, diag::warn_arc_bridge_cast_nonarc)
- << BridgeCastName
- << FixItHint::CreateReplacement(BridgeKeywordLoc, "");
+ if (Tok.isNot(tok::kw___bridge)) {
+ StringRef BridgeCastName = Tok.getName();
+ SourceLocation BridgeKeywordLoc = ConsumeToken();
+ if (!PP.getSourceManager().isInSystemHeader(BridgeKeywordLoc))
+ Diag(BridgeKeywordLoc, diag::warn_arc_bridge_cast_nonarc)
+ << BridgeCastName
+ << FixItHint::CreateReplacement(BridgeKeywordLoc, "");
+ }
+ else
+ ConsumeToken(); // consume __bridge
BridgeCast = false;
}
OpenPOWER on IntegriCloud