~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ast2/AST2KnRTests.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2013-10-03 20:30:16 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20131003203016-d4ug6l0xgosasumq
Tags: 8.2.1-1
* New upstream release.
* Updated autotools documentation sources.

Show diffs side-by-side

added added

removed removed

Lines of Context:
637
637
        assertTrue(stmts[3] instanceof IASTNullStatement);
638
638
    }
639
639
    
640
 
    // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=203050
 
640
        //  typedef long time_t;
 
641
        //
 
642
        //  void (foo)(timep)
 
643
        //      const time_t * const timep;
 
644
        //  {
 
645
        //      struct tm tmp;
 
646
        //
 
647
        //      bar(timep, &tmp);
 
648
        //  }
 
649
        //
 
650
        //  int (bar)(timep, tmp)
 
651
        //      const time_t * const    timep;
 
652
        //      struct tm * tmp;
 
653
        //  {
 
654
        //      return 0;
 
655
        //  }
641
656
    public void testBug203050() throws Exception {
642
 
        StringBuilder buffer = new StringBuilder();
643
 
        buffer.append("typedef long time_t;\n" +  //$NON-NLS-1$
644
 
                        "\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$
657
 
        
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);