mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-01 13:25:45 +02:00
Fixing Doug's checkin.
This commit is contained in:
parent
6924155bcb
commit
3f37eb5c27
2 changed files with 17 additions and 1 deletions
|
@ -1922,5 +1922,18 @@ public class AST2CPPTests extends AST2BaseTest {
|
||||||
IBinding [] bs = CPPSemantics.prefixLookup( name );
|
IBinding [] bs = CPPSemantics.prefixLookup( name );
|
||||||
assertEquals( 4, bs.length );
|
assertEquals( 4, bs.length );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBug85310() throws Exception
|
||||||
|
{
|
||||||
|
StringBuffer buffer = new StringBuffer( "void f() {" ); //$NON-NLS-1$
|
||||||
|
buffer.append( " if (__io.flags() & ios_base::showbase" ); //$NON-NLS-1$
|
||||||
|
buffer.append( " || __i < 2 || __sign.size() > 1" ); //$NON-NLS-1$
|
||||||
|
buffer.append( " || ((static_cast<part>(__p.field[3]) != money_base::none)" ); //$NON-NLS-1$
|
||||||
|
buffer.append( " && __i == 2)) " ); //$NON-NLS-1$
|
||||||
|
buffer.append( " return;" ); //$NON-NLS-1$
|
||||||
|
buffer.append( "}"); //$NON-NLS-1$
|
||||||
|
String code = buffer.toString();
|
||||||
|
IASTTranslationUnit tu = parse( code, ParserLanguage.CPP );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1461,7 +1461,10 @@ public abstract class AbstractGNUSourceCodeParser implements ISourceCodeParser {
|
||||||
BacktrackException savedBt = null;
|
BacktrackException savedBt = null;
|
||||||
try {
|
try {
|
||||||
IASTExpression expression = expression();
|
IASTExpression expression = expression();
|
||||||
lastTokenOfExpression = consume(); // SEMI or EOC
|
if( LT(1) == IToken.tEOC )
|
||||||
|
lastTokenOfExpression = consume();
|
||||||
|
else
|
||||||
|
lastTokenOfExpression = consume( IToken.tSEMI );
|
||||||
expressionStatement = createExpressionStatement();
|
expressionStatement = createExpressionStatement();
|
||||||
expressionStatement.setExpression(expression);
|
expressionStatement.setExpression(expression);
|
||||||
((ASTNode) expressionStatement).setOffsetAndLength(
|
((ASTNode) expressionStatement).setOffsetAndLength(
|
||||||
|
|
Loading…
Add table
Reference in a new issue