diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2015-03-12 14:28:47 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2015-03-12 14:28:47 +0000 |
commit | 8610cae98a3f39545362e274ff77b641acb0b03b (patch) | |
tree | 6a1b1c029c79c948e5f19ce45593f7698b25b035 /clang/lib/Parse/Parser.cpp | |
parent | e4812148e13cbde16b24adaa261c42bdad52d80b (diff) | |
download | bcm5719-llvm-8610cae98a3f39545362e274ff77b641acb0b03b.tar.gz bcm5719-llvm-8610cae98a3f39545362e274ff77b641acb0b03b.zip |
Sema: Don't emit a missing prototype warning for deleted functions.
This is a bit more involved than I anticipated, so here's a breakdown
of the changes:
1. Call ActOnFinishFunctionBody _after_ we parsed =default and
=delete specifiers. Saying that we finished the body before parsing
=default is just wrong. Changing this allows us to use isDefaulted
and isDeleted on a decl in ActOnFinishFunctionBody.
2. Check for -Wmissing-prototypes after we parsed the function body.
3. Disable -Wmissing-prototypes when the Decl isDeleted.
llvm-svn: 232040
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r-- | clang/lib/Parse/Parser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp index 7ccd2092a2d..3b56102dcfa 100644 --- a/clang/lib/Parse/Parser.cpp +++ b/clang/lib/Parse/Parser.cpp @@ -1048,7 +1048,6 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D, if (TryConsumeToken(tok::equal)) { assert(getLangOpts().CPlusPlus && "Only C++ function definitions have '='"); - Actions.ActOnFinishFunctionBody(Res, nullptr, false); bool Delete = false; SourceLocation KWLoc; @@ -1076,6 +1075,8 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator &D, SkipUntil(tok::semi); } + Stmt *GeneratedBody = Res ? Res->getBody() : nullptr; + Actions.ActOnFinishFunctionBody(Res, GeneratedBody, false); return Res; } |