637
637
assertTrue(stmts[3] instanceof IASTNullStatement);
640
// see https://bugs.eclipse.org/bugs/show_bug.cgi?id=203050
640
// typedef long time_t;
643
// const time_t * const timep;
650
// int (bar)(timep, tmp)
651
// const time_t * const timep;
641
656
public void testBug203050() throws Exception {
642
StringBuilder buffer = new StringBuilder();
643
buffer.append("typedef long time_t;\n" + //$NON-NLS-1$
645
"void (foo) (timep)\n" + //$NON-NLS-1$
646
" const time_t * const timep;\n" + //$NON-NLS-1$
647
"{\n" + //$NON-NLS-1$
648
" struct tm tmp;\n" + //$NON-NLS-1$
649
" bar(timep, &tmp);\n" + //$NON-NLS-1$
650
"}\n" + //$NON-NLS-1$
651
"int (bar) (timep, tmp)\n" + //$NON-NLS-1$
652
" const time_t * const timep;\n" + //$NON-NLS-1$
653
" struct tm * tmp;\n" + //$NON-NLS-1$
654
"{\n" + //$NON-NLS-1$
655
" return 0;\n" + //$NON-NLS-1$
656
"}\n"); //$NON-NLS-1$
658
IASTTranslationUnit tu = parse(buffer.toString(), ParserLanguage.C, true, true);
657
IASTTranslationUnit tu = parse(getAboveComment(), ParserLanguage.C, true, true);
659
658
assertTrue(tu.getDeclarations()[0] instanceof IASTSimpleDeclaration);
660
659
assertTrue(tu.getDeclarations()[1] instanceof IASTFunctionDefinition);
661
660
assertTrue(tu.getDeclarations()[2] instanceof IASTFunctionDefinition);