summaryrefslogtreecommitdiffstats
path: root/lib/Parse/ParseExpr.cpp
diff options
context:
space:
mode:
authorAlex Lorenz <arphaman@gmail.com>2017-01-06 11:31:12 +0000
committerAlex Lorenz <arphaman@gmail.com>2017-01-06 11:31:12 +0000
commitda684cc5fb0320f69201b1baf1eb8b9cc7d04cba (patch)
tree645d6d7771cc4afedd4ea4cace9f06b8a85e0612 /lib/Parse/ParseExpr.cpp
parent95ab3391525058956e409754b36fd04f2b9c5bb8 (diff)
[ObjC] The declarator for a block literal should be a definition
This change avoids the -Wstrict-prototypes warning for block literals with an empty argument list or without argument lists. rdar://15060615 Differential Revision: https://reviews.llvm.org/D28296 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291231 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExpr.cpp')
-rw-r--r--lib/Parse/ParseExpr.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/Parse/ParseExpr.cpp b/lib/Parse/ParseExpr.cpp
index caf2320f8f..55b5ff4985 100644
--- a/lib/Parse/ParseExpr.cpp
+++ b/lib/Parse/ParseExpr.cpp
@@ -2751,6 +2751,7 @@ void Parser::ParseBlockId(SourceLocation CaretLoc) {
// Parse the block-declarator.
Declarator DeclaratorInfo(DS, Declarator::BlockLiteralContext);
+ DeclaratorInfo.setFunctionDefinitionKind(FDK_Definition);
ParseDeclarator(DeclaratorInfo);
MaybeParseGNUAttributes(DeclaratorInfo);
@@ -2789,6 +2790,7 @@ ExprResult Parser::ParseBlockLiteralExpression() {
// Parse the return type if present.
DeclSpec DS(AttrFactory);
Declarator ParamInfo(DS, Declarator::BlockLiteralContext);
+ ParamInfo.setFunctionDefinitionKind(FDK_Definition);
// FIXME: Since the return type isn't actually parsed, it can't be used to
// fill ParamInfo with an initial valid range, so do it manually.
ParamInfo.SetSourceRange(SourceRange(Tok.getLocation(), Tok.getLocation()));