diff --git a/core/org.eclipse.cdt.core.tests/ChangeLog b/core/org.eclipse.cdt.core.tests/ChangeLog index b873b4cfeeb..2f98aa23ea1 100644 --- a/core/org.eclipse.cdt.core.tests/ChangeLog +++ b/core/org.eclipse.cdt.core.tests/ChangeLog @@ -1,3 +1,6 @@ +2004-01-06 John Camelon + Added CompleteParseASTTest::testBug43110() and QuickParseASTTests::testBug43110(). + 2003-12-31 Hoda Amer Small change to test parameters with initial clause in ITemplateTest diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java index a9502d6e806..6ea8cc3d3f5 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/CompleteParseASTTest.java @@ -1102,4 +1102,15 @@ public class CompleteParseASTTest extends CompleteParseBaseTest assertAllReferences( 5, createTaskList( new Task( namespace, 2 ), new Task( classA, 2 ), new Task( a ) ) ); } + + public void testBug43110() throws Exception + { + StringBuffer buffer = new StringBuffer(); + buffer.append("void x( int y, ... );\n"); + buffer.append("void y( int x... );\n"); + buffer.append("void z(...);"); + Iterator i = parse(buffer.toString() ).getDeclarations(); + while( i.hasNext() ) + assertTrue( ((IASTFunction)i.next()).takesVarArgs() ); + } } diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java index 1e2723e608d..04fa8c01631 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/QuickParseASTTests.java @@ -2022,4 +2022,12 @@ public class QuickParseASTTests extends BaseASTTest assertEquals( exp.getLiteralString(), "ab"); } + public void testBug43110() throws Exception + { + IASTFunction function = (IASTFunction) assertSoleDeclaration( "void x( int y, ... );"); + assertTrue( function.takesVarArgs() ); + function = (IASTFunction) assertSoleDeclaration( "void x( int y... );"); + assertTrue( function.takesVarArgs() ); + } + } \ No newline at end of file diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java index df7a0626095..5949a616bd3 100644 --- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java +++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/core/parser/tests/ScannerTestCase.java @@ -190,7 +190,7 @@ public class ScannerTestCase extends BaseScannerTest validateFloatingPointLiteral( "3."); validateFloatingPointLiteral( "4E5"); validateFloatingPointLiteral( "2.01E-03" ); - validateToken( IToken.tELIPSE ); + validateToken( IToken.tELLIPSIS ); validateEOF(); } catch( ScannerException se ) @@ -1033,7 +1033,7 @@ public class ScannerTestCase extends BaseScannerTest initializeScanner( "foo...bar"); validateIdentifier("foo"); - validateToken( IToken.tELIPSE ); + validateToken( IToken.tELLIPSIS ); validateIdentifier("bar"); validateEOF(); } diff --git a/core/org.eclipse.cdt.core/parser/ChangeLog-parser b/core/org.eclipse.cdt.core/parser/ChangeLog-parser index f75f012827a..493eae9314f 100644 --- a/core/org.eclipse.cdt.core/parser/ChangeLog-parser +++ b/core/org.eclipse.cdt.core/parser/ChangeLog-parser @@ -1,3 +1,7 @@ +2004-01-06 John Camelon + Renamed IToken::tELIPSE to IToken::tELLIPSIS + Partially fixed Bug 43110 : Parser support needed for functions with ellipses + 2004-01-05 John Camelon Removed warnings. Moved StructuralParseCallback from model to parser directory to facilitate building the parser standalone. diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IToken.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IToken.java index 008ca2e9c9d..e907913afff 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IToken.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/IToken.java @@ -123,7 +123,7 @@ public interface IToken { static public final int tSHIFTLASSIGN = 47; - static public final int tELIPSE = 48; + static public final int tELLIPSIS = 48; static public final int tDOTSTAR = 49; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java index 3adcc607080..fce77f8eb8b 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFactory.java @@ -26,7 +26,7 @@ public interface IASTFactory String name, int startingOffset, int nameOffset, - int nameEndOffset, int endingOffset) ; + int nameEndOffset, int endingOffset); public IASTInclusion createInclusion( String name, @@ -131,7 +131,7 @@ public interface IASTFactory /** * @param exp */ - public IASTArrayModifier createArrayModifier(IASTExpression exp) ; + public IASTArrayModifier createArrayModifier(IASTExpression exp); /** * @param duple @@ -169,7 +169,7 @@ public interface IASTFactory boolean isVolatile, boolean isVirtual, boolean isExplicit, - boolean isPureVirtual, List constructorChain, boolean isDefinition, boolean hasFunctionTryBlock ) throws ASTSemanticException; + boolean isPureVirtual, List constructorChain, boolean isDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) throws ASTSemanticException; public IASTAbstractDeclaration createAbstractDeclaration( @@ -195,7 +195,7 @@ public interface IASTFactory boolean isVolatile, boolean isVirtual, boolean isExplicit, - boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean isDefinition, boolean hasFunctionTryBlock) throws ASTSemanticException; + boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean isDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments) throws ASTSemanticException; public IASTVariable createVariable(IASTScope scope, String name, boolean isAuto, IASTInitializerClause initializerClause, IASTExpression bitfieldExpression, IASTAbstractDeclaration abstractDeclaration, boolean isMutable, boolean isExtern, boolean isRegister, boolean isStatic, int startingOffset, int nameOffset, int nameEndOffset, IASTExpression constructorExpression ) throws ASTSemanticException; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java index 7691013db63..bd322cce2c1 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/core/parser/ast/IASTFunction.java @@ -22,6 +22,8 @@ public interface IASTFunction extends IASTCodeScope, IASTOffsetableNamedElement, public boolean isFriend(); public boolean isStatic(); + public boolean takesVarArgs(); + public String getName(); public IASTAbstractDeclaration getReturnType(); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java index 1e834edaae3..ebf5b0ba9ef 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/DeclarationWrapper.java @@ -483,7 +483,7 @@ public class DeclarationWrapper implements IDeclaratorOwner virtual, explicit, declarator.isPureVirtual(), ((IASTClassSpecifier)scope).getCurrentVisibilityMode(), - declarator.getConstructorMemberInitializers(), declarator.hasFunctionBody(), declarator.hasFunctionTryBlock()); + declarator.getConstructorMemberInitializers(), declarator.hasFunctionBody(), declarator.hasFunctionTryBlock(), declarator.isVarArgs()); } catch (ASTSemanticException e) { @@ -524,7 +524,8 @@ public class DeclarationWrapper implements IDeclaratorOwner virtual, explicit, declarator.isPureVirtual(), - declarator.getConstructorMemberInitializers(), declarator.hasFunctionBody(), declarator.hasFunctionTryBlock() ); + declarator.getConstructorMemberInitializers(), declarator.hasFunctionBody(), declarator.hasFunctionTryBlock(), + declarator.isVarArgs() ); } catch (ASTSemanticException e) { diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Declarator.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Declarator.java index 580f8099454..1d4d0f120c8 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Declarator.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Declarator.java @@ -51,7 +51,8 @@ public class Declarator implements IParameterCollection, IDeclaratorOwner, IDecl private boolean isKandR = false; - private int nameStartOffset, nameEndOffset; + private int nameStartOffset, nameEndOffset; + private boolean varArgs; public Declarator( IDeclaratorOwner owner ) { @@ -433,4 +434,18 @@ public class Declarator implements IParameterCollection, IDeclaratorOwner, IDecl hasFunctionTryBlock = b; } + /** + * @param b + */ + public void setIsVarArgs(boolean b) { + varArgs = b; + } + + /** + * @return Returns the varArgs. + */ + public boolean isVarArgs() { + return varArgs; + } + } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java index 21b4ca75204..9858e5568af 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Parser.java @@ -2198,8 +2198,9 @@ public abstract class Parser implements IParser case IToken.tRPAREN : consume(); break parameterDeclarationLoop; - case IToken.tELIPSE : + case IToken.tELLIPSIS : consume(); + d.setIsVarArgs( true ); break; case IToken.tCOMMA : consume(); @@ -3046,8 +3047,8 @@ public abstract class Parser implements IParser { consume(IToken.t_catch); consume(IToken.tLPAREN); - if( LT(1) == IToken.tELIPSE ) - consume( IToken.tELIPSE ); + if( LT(1) == IToken.tELLIPSIS ) + consume( IToken.tELLIPSIS ); else declaration(scope, null); // was exceptionDeclaration consume(IToken.tRPAREN); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java index a15716ca6f7..6b6959b3384 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/Scanner.java @@ -944,7 +944,7 @@ public class Scanner implements IScanner { return newToken( IToken.tDOTSTAR, ".*", contextStack.getCurrentContext() ); } else if( c == '.' ){ if( getChar() == '.' ) - return newToken( IToken.tELIPSE, "..." ); + return newToken( IToken.tELLIPSIS, "..." ); else handleProblem( IProblem.SCANNER_BAD_FLOATING_POINT, null, beginOffset, false, true, true ); } else { @@ -1557,7 +1557,7 @@ public class Scanner implements IScanner { switch (c) { case '.' : return newToken( - IToken.tELIPSE, + IToken.tELLIPSIS, "...", contextStack.getCurrentContext()); default : diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunction.java index cd3979e2147..b1429e92548 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTFunction.java @@ -55,7 +55,7 @@ public class ASTFunction extends ASTScope implements IASTFunction * @param ownerTemplate * @param references */ - public ASTFunction(IParameterizedSymbol symbol, int nameEndOffset, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, int startOffset, int nameOffset, IASTTemplate ownerTemplate, List references, boolean previouslyDeclared, boolean hasFunctionTryBlock ) + public ASTFunction(IParameterizedSymbol symbol, int nameEndOffset, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, int startOffset, int nameOffset, IASTTemplate ownerTemplate, List references, boolean previouslyDeclared, boolean hasFunctionTryBlock, boolean hasVarArgs) { super( symbol ); this.parameters = parameters; @@ -70,6 +70,7 @@ public class ASTFunction extends ASTScope implements IASTFunction qualifiedName = new ASTQualifiedNamedElement( getOwnerScope(), symbol.getName() ); this.previouslyDeclared =previouslyDeclared; this.hasFunctionTryBlock = hasFunctionTryBlock; + this.varArgs = hasVarArgs; } @@ -305,6 +306,7 @@ public class ASTFunction extends ASTScope implements IASTFunction private boolean hasFunctionTryBlock = false; + private final boolean varArgs; /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionTryBlock(boolean) */ @@ -329,5 +331,12 @@ public class ASTFunction extends ASTScope implements IASTFunction { declarations.add(declaration); } - + + + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ast.IASTFunction#takesVarArgs() + */ + public boolean takesVarArgs() { + return varArgs; + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java index b1fbb19e06e..c3f997ab272 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/ASTMethod.java @@ -46,7 +46,7 @@ public class ASTMethod extends ASTFunction implements IASTMethod * @param references */ public ASTMethod(IParameterizedSymbol symbol, int nameEndOffset, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, int startOffset, int nameOffset, IASTTemplate ownerTemplate, List references, boolean previouslyDeclared, - boolean isConstructor, boolean isDestructor, boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean hasFunctionTryBlock ) + boolean isConstructor, boolean isDestructor, boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean hasFunctionTryBlock, boolean hasVariableArguments ) { super( symbol, @@ -57,7 +57,7 @@ public class ASTMethod extends ASTFunction implements IASTMethod startOffset, nameOffset, ownerTemplate, - references, previouslyDeclared, hasFunctionTryBlock ); + references, previouslyDeclared, hasFunctionTryBlock, hasVariableArguments ); this.visibility = visibility; this.isConstructor = isConstructor; this.isDestructor = isDestructor; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java index 579cedb3704..8273a023005 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/complete/CompleteParseASTFactory.java @@ -1596,7 +1596,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto boolean isExplicit, boolean isPureVirtual, List constructorChain, - boolean isFunctionDefinition, boolean hasFunctionTryBlock ) throws ASTSemanticException + boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) throws ASTSemanticException { List references = new ArrayList(); IContainerSymbol ownerScope = scopeToSymbol( scope ); @@ -1641,7 +1641,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto ASTAccessVisibility.PRIVATE, constructorChain, references, - isFunctionDefinition, hasFunctionTryBlock ); + isFunctionDefinition, hasFunctionTryBlock, hasVariableArguments ); } } @@ -1684,7 +1684,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto { throw new ASTSemanticException(); } - ASTFunction function = new ASTFunction( symbol, nameEndOffset, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, previouslyDeclared, hasFunctionTryBlock ); + ASTFunction function = new ASTFunction( symbol, nameEndOffset, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, previouslyDeclared, hasFunctionTryBlock, hasVariableArguments ); try { attachSymbolExtension(symbol, function); @@ -1892,12 +1892,12 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto boolean isVirtual, boolean isExplicit, boolean isPureVirtual, - ASTAccessVisibility visibility, List constructorChain, boolean isFunctionDefinition, boolean hasFunctionTryBlock ) throws ASTSemanticException + ASTAccessVisibility visibility, List constructorChain, boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) throws ASTSemanticException { return createMethod(scope, name, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, nameEndOffset, ownerTemplate, isConst, isVolatile, isVirtual, isExplicit, isPureVirtual, - visibility, constructorChain, null, isFunctionDefinition, hasFunctionTryBlock ); + visibility, constructorChain, null, isFunctionDefinition, hasFunctionTryBlock, hasVariableArguments ); } public IASTMethod createMethod( @@ -1920,7 +1920,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, - List references, boolean isFunctionDefinition, boolean hasFunctionTryBlock ) throws ASTSemanticException + List references, boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) throws ASTSemanticException { boolean isConstructor = false; boolean isDestructor = false; @@ -1997,7 +1997,7 @@ public class CompleteParseASTFactory extends BaseASTFactory implements IASTFacto resolveLeftoverConstructorInitializerMembers( symbol, constructorChain ); - ASTMethod method = new ASTMethod( symbol, nameEndOffset, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, previouslyDeclared, isConstructor, isDestructor, isPureVirtual, visibility, constructorChain, hasFunctionTryBlock ); + ASTMethod method = new ASTMethod( symbol, nameEndOffset, parameters, returnType, exception, startOffset, nameOffset, ownerTemplate, references, previouslyDeclared, isConstructor, isDestructor, isPureVirtual, visibility, constructorChain, hasFunctionTryBlock, hasVariableArguments ); try { attachSymbolExtension( symbol, method ); diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java index 30ced139b51..d96d63e4545 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTFunction.java @@ -35,7 +35,7 @@ public class ASTFunction extends ASTDeclaration implements IASTFunction * @param scope */ public ASTFunction(IASTScope scope, String name, int nameEndOffset, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, - boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean hasFunctionTryBlock ) + boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, IASTTemplate ownerTemplate, boolean hasFunctionTryBlock, boolean hasVarArgs ) { super(ownerTemplate != null ? null : scope ); this.name = name; @@ -53,6 +53,7 @@ public class ASTFunction extends ASTDeclaration implements IASTFunction qualifiedName = new ASTQualifiedNamedElement( scope, name ); setNameEndOffset(nameEndOffset); this.hasFunctionTryBlock = hasFunctionTryBlock; + this.varArgs = hasVarArgs; } private boolean previouslyDeclared; @@ -265,6 +266,7 @@ public class ASTFunction extends ASTDeclaration implements IASTFunction } private boolean hasFunctionTryBlock = false; + private final boolean varArgs; /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFunction#setHasFunctionTryBlock(boolean) */ @@ -280,4 +282,10 @@ public class ASTFunction extends ASTDeclaration implements IASTFunction { return hasFunctionTryBlock; } + /* (non-Javadoc) + * @see org.eclipse.cdt.core.parser.ast.IASTFunction#takesVarArgs() + */ + public boolean takesVarArgs() { + return varArgs; + } } diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java index bb05d5991f8..eca84f1c592 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/ASTMethod.java @@ -71,7 +71,7 @@ public class ASTMethod extends ASTFunction implements IASTMethod boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChainElements, - boolean hasFunctionTryBlock ) + boolean hasFunctionTryBlock, boolean hasVarArgs ) { super( scope, @@ -85,7 +85,7 @@ public class ASTMethod extends ASTFunction implements IASTMethod isStatic, startOffset, nameOffset, - ownerTemplate, hasFunctionTryBlock); + ownerTemplate, hasFunctionTryBlock, hasVarArgs); this.isVirtual = isVirtual; this.isPureVirtual = isPureVirtual; this.isConstructor = isConstructor; diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java index 4cf9c136f57..b054ba4f444 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/parser/ast/quick/QuickParseASTFactory.java @@ -185,17 +185,17 @@ public class QuickParseASTFactory extends BaseASTFactory implements IASTFactory /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createFunction(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration) */ - public IASTFunction createFunction(IASTScope scope, ITokenDuple name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, int nameEndOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, List constructorChain, boolean isFunctionDefinition, boolean hasFunctionTryBlock ) + public IASTFunction createFunction(IASTScope scope, ITokenDuple name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, int nameEndOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, List constructorChain, boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) { - return new ASTFunction(scope, name.toString(), nameEndOffset, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, hasFunctionTryBlock ); + return new ASTFunction(scope, name.toString(), nameEndOffset, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, hasFunctionTryBlock, hasVariableArguments ); } /* (non-Javadoc) * @see org.eclipse.cdt.core.parser.ast.IASTFactory#createMethod(org.eclipse.cdt.core.parser.ast.IASTScope, java.lang.String, java.util.List, org.eclipse.cdt.core.parser.ast.IASTAbstractDeclaration, org.eclipse.cdt.core.parser.ast.IASTExceptionSpecification, boolean, boolean, boolean, int, int, org.eclipse.cdt.core.parser.ast.IASTTemplateDeclaration, boolean, boolean, boolean, boolean, boolean, boolean, boolean, org.eclipse.cdt.core.parser.ast.ASTAccessVisibility) */ - public IASTMethod createMethod(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, int nameEndOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean isFunctionDefinition, boolean hasFunctionTryBlock ) + public IASTMethod createMethod(IASTScope scope, String name, List parameters, IASTAbstractDeclaration returnType, IASTExceptionSpecification exception, boolean isInline, boolean isFriend, boolean isStatic, int startOffset, int nameOffset, int nameEndOffset, IASTTemplate ownerTemplate, boolean isConst, boolean isVolatile, boolean isVirtual, boolean isExplicit, boolean isPureVirtual, ASTAccessVisibility visibility, List constructorChain, boolean isFunctionDefinition, boolean hasFunctionTryBlock, boolean hasVariableArguments ) { - return new ASTMethod(scope, name, nameEndOffset, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, isConst, isVolatile, false, false, isVirtual, isExplicit, isPureVirtual, visibility, constructorChain, hasFunctionTryBlock); + return new ASTMethod(scope, name, nameEndOffset, parameters, returnType, exception, isInline, isFriend, isStatic, startOffset, nameOffset, ownerTemplate, isConst, isVolatile, false, false, isVirtual, isExplicit, isPureVirtual, visibility, constructorChain, hasFunctionTryBlock, hasVariableArguments); } /* (non-Javadoc)