aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseStmt.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-05-16 04:20:04 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-05-16 04:20:04 +0000
commitdef07624ecc535431e0c814b4b5b842de8a06997 (patch)
treeef80aa5f735a15cd966f09d1ef331c98dee64811 /lib/Parse/ParseStmt.cpp
parent797105a45a838a7c1cefd05dec3fd0cbaeb0a215 (diff)
Include the correct conversion context locations for condition expressions.
This improves the conversion diagnostics (by correctly pointing to the loop construct for conversions that may've been caused by the contextual conversion to bool caused by a condition expression) and also causes the NULL conversion warnings to be correctly suppressed when crossing a macro boundary in such a context. (previously, since the conversion context location was incorrect, the suppression could not be performed) Reported by Nico Weber as feedback to r156826. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156901 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r--lib/Parse/ParseStmt.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp
index 9796ea69ba..6652beaff4 100644
--- a/lib/Parse/ParseStmt.cpp
+++ b/lib/Parse/ParseStmt.cpp
@@ -948,7 +948,7 @@ StmtResult Parser::ParseIfStatement(SourceLocation *TrailingElseLoc) {
if (ParseParenExprOrCondition(CondExp, CondVar, IfLoc, true))
return StmtError();
- FullExprArg FullCondExp(Actions.MakeFullExpr(CondExp.get()));
+ FullExprArg FullCondExp(Actions.MakeFullExpr(CondExp.get(), IfLoc));
// C99 6.8.4p3 - In C99, the body of the if statement is a scope, even if
// there is no compound stmt. C90 does not have this clause. We only do this
@@ -1174,7 +1174,7 @@ StmtResult Parser::ParseWhileStatement(SourceLocation *TrailingElseLoc) {
if (ParseParenExprOrCondition(Cond, CondVar, WhileLoc, true))
return StmtError();
- FullExprArg FullCond(Actions.MakeFullExpr(Cond.get()));
+ FullExprArg FullCond(Actions.MakeFullExpr(Cond.get(), WhileLoc));
// C99 6.8.5p5 - In C99, the body of the if statement is a scope, even if
// there is no compound stmt. C90 does not have this clause. We only do this
@@ -1451,7 +1451,7 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) {
Second.get());
}
SecondPartIsInvalid = Second.isInvalid();
- SecondPart = Actions.MakeFullExpr(Second.get());
+ SecondPart = Actions.MakeFullExpr(Second.get(), ForLoc);
}
if (Tok.isNot(tok::semi)) {