[cfe-commits] r52696 - /cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Tue Jun 24 15:31:41 PDT 2008
Author: akirtzidis
Date: Tue Jun 24 17:31:41 2008
New Revision: 52696
URL: http://llvm.org/viewvc/llvm-project?rev=52696&view=rev
Log:
The only caller of this knows that the current token is l_brace, so this can be an assert; suggestion by Chris.
Modified:
cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
Modified: cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp?rev=52696&r1=52695&r2=52696&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp (original)
+++ cfe/trunk/lib/Parse/ParseCXXInlineMethods.cpp Tue Jun 24 17:31:41 2008
@@ -23,21 +23,10 @@
Parser::ParseCXXInlineMethodDef(AccessSpecifier AS, Declarator &D) {
assert(D.getTypeObject(0).Kind == DeclaratorChunk::Function &&
"This isn't a function declarator!");
+ assert(Tok.is(tok::l_brace) && "Current token not a '{'!");
DeclTy *FnD = Actions.ActOnCXXMemberDeclarator(CurScope, AS, D, 0, 0, 0);
- // We should have an opening brace now.
- if (Tok.isNot(tok::l_brace)) {
- Diag(Tok, diag::err_expected_fn_body);
-
- // Skip over garbage, until we get to '{'. Don't eat the '{'.
- SkipUntil(tok::l_brace, true, true);
-
- // If we didn't find the '{', bail out.
- if (Tok.isNot(tok::l_brace))
- return FnD;
- }
-
// Consume the tokens and store them for later parsing.
getCurTopClassStack().push(LexedMethod(FnD));
More information about the cfe-commits
mailing list