C++: Add parser support for @throw statements.

Change-Id: I366733ec821ee264f182f4d4a3cf69cdada20cfc
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Erik Verbruggen
2013-07-18 10:25:19 +02:00
committed by Nikolai Kosjar
parent a32343b96e
commit c2d2173934
3 changed files with 41 additions and 0 deletions

View File

@@ -162,6 +162,7 @@ private slots:
void objc_try_statement_1();
void objc_try_statement_2();
void objc_try_statement_3();
void objc_throw_statement();
// expressions with (square) brackets
void normal_array_access();
@@ -1437,6 +1438,22 @@ void tst_AST::objc_try_statement_3()
QCOMPARE(diag.errorCount, 0);
}
void tst_AST::objc_throw_statement()
{
QSharedPointer<TranslationUnit> unit(
parseDeclaration(
"void tst() {\n"
" NSException *up = [NSException exceptionWithName:@\"NoException\"\n"
" reason:@\"No Reason :-)\"\n"
" userInfo:nil];\n"
" @throw up;\n"
"}\n"
));
AST *ast = unit->ast();
QVERIFY(ast);
QCOMPARE(diag.errorCount, 0);
}
void tst_AST::normal_array_access()
{
QSharedPointer<TranslationUnit> unit(parseDeclaration("\n"