summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Parse/Parser.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index 8e6e0feb129..ca425e8b052 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -507,12 +507,13 @@ bool Parser::isDeclarationAfterDeclarator() {
/// \brief Determine whether the current token, if it occurs after a
/// declarator, indicates the start of a function definition.
bool Parser::isStartOfFunctionDefinition() {
- return Tok.is(tok::l_brace) || // int X() {}
- (!getLang().CPlusPlus &&
- isDeclarationSpecifier()) || // int X(f) int f; {}
- (getLang().CPlusPlus &&
- (Tok.is(tok::colon) || // X() : Base() {} (used for ctors)
- Tok.is(tok::kw_try))); // X() try { ... }
+ if (Tok.is(tok::l_brace)) // int X() {}
+ return true;
+
+ if (!getLang().CPlusPlus)
+ return isDeclarationSpecifier(); // int X(f) int f; {}
+ return Tok.is(tok::colon) || // X() : Base() {} (used for ctors)
+ Tok.is(tok::kw_try); // X() try { ... }
}
/// ParseDeclarationOrFunctionDefinition - Parse either a function-definition or
OpenPOWER on IntegriCloud