1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-31 12:55:40 +02:00

Patch for Victor Mozgin

Fixed PR 39540 : Parser fails on const qualifier after class specifier
This commit is contained in:
John Camelon 2003-07-31 13:14:32 +00:00
parent 022ba9b789
commit c2e6e9ec5b
5 changed files with 16 additions and 6 deletions

View file

@ -1,3 +1,6 @@
2003-07-31 Victor Mozgin
Moved testBug39540() from ASTFailedTests.java to QuickParseASTTests.java.
2003-07-30 Hoda Amer 2003-07-30 Hoda Amer
The CModelElementsTests has the pointer to function test back in its original place The CModelElementsTests has the pointer to function test back in its original place
(a variable) (a variable)

View file

@ -106,10 +106,6 @@ public class ASTFailedTests extends BaseASTTest
{ {
assertCodeFailsParse("template C::operator int<float> ();"); assertCodeFailsParse("template C::operator int<float> ();");
} }
public void testBug39540() throws Exception
{
assertCodeFailsParse("class {} const null;");
}
public void testBug39542() throws Exception public void testBug39542() throws Exception
{ {
assertCodeFailsParse("void f(int a, struct {int b[a];} c) {}"); assertCodeFailsParse("void f(int a, struct {int b[a];} c) {}");

View file

@ -1757,4 +1757,10 @@ public class QuickParseASTTests extends BaseASTTest
parse("class N1::N2::B : public A {};"); parse("class N1::N2::B : public A {};");
assertTrue( quickParseCallback.getCompilationUnit().getDeclarations().hasNext() ); assertTrue( quickParseCallback.getCompilationUnit().getDeclarations().hasNext() );
} }
public void testBug39540() throws Exception
{
parse("class {} const null;");
assertTrue( quickParseCallback.getCompilationUnit().getDeclarations().hasNext() );
}
} }

View file

@ -1,3 +1,6 @@
2003-07-31 Victor Mozgin
Fixed PR 39540 : Parser fails on const qualifier after class specifier.
2003-07-30 Victor Mozgin 2003-07-30 Victor Mozgin
Fixed PR 39532 : Parser fails on fully-qualified class names. Fixed PR 39532 : Parser fails on fully-qualified class names.

View file

@ -1359,7 +1359,7 @@ public class Parser implements IParser
ITokenDuple duple = new TokenDuple(first, last); ITokenDuple duple = new TokenDuple(first, last);
sdw.setTypeName(duple); sdw.setTypeName(duple);
return; break;
case IToken.tCOLONCOLON : case IToken.tCOLONCOLON :
consume(IToken.tCOLONCOLON); consume(IToken.tCOLONCOLON);
// handle nested later: // handle nested later:
@ -1408,7 +1408,8 @@ public class Parser implements IParser
try try
{ {
classSpecifier(sdw); classSpecifier(sdw);
return; flags.setEncounteredTypename(true);
break;
} }
catch (Backtrack bt) catch (Backtrack bt)
{ {
@ -1429,6 +1430,7 @@ public class Parser implements IParser
try try
{ {
enumSpecifier(sdw); enumSpecifier(sdw);
flags.setEncounteredTypename(true);
break; break;
} }
catch (Backtrack bt) catch (Backtrack bt)