forked from qt-creator/qt-creator
C++: Add parser support for @throw statements.
Change-Id: I366733ec821ee264f182f4d4a3cf69cdada20cfc Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Nikolai Kosjar
parent
a32343b96e
commit
c2d2173934
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user