mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Patch for Andrew Niefer
core: PST changes: - modify lookupConstructor to copy the constructor list before resolving on it - modify checkUserDefinedConversionSequence the same way - modify isValidFunctionOverload to check for forward declarations core.tests: - added testBug43951 to CompleteParseASTTest
This commit is contained in:
parent
9b33f17d3f
commit
e63b06fc5f
4 changed files with 34 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
2003-10-01 Andrew Niefer
|
||||||
|
added testBug43951 to CompleteParseASTTest
|
||||||
|
|
||||||
2003-10-01 Andrew Niefer
|
2003-10-01 Andrew Niefer
|
||||||
modified OtherPatternTests.testBug42911() and renamed it testBug42911_43988
|
modified OtherPatternTests.testBug42911() and renamed it testBug42911_43988
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,6 @@ import org.eclipse.cdt.core.parser.ast.IASTFunction;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification;
|
import org.eclipse.cdt.core.parser.ast.IASTLinkageSpecification;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTMethod;
|
import org.eclipse.cdt.core.parser.ast.IASTMethod;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
|
import org.eclipse.cdt.core.parser.ast.IASTNamespaceDefinition;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTOffsetableElement;
|
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTReference;
|
import org.eclipse.cdt.core.parser.ast.IASTReference;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTScope;
|
import org.eclipse.cdt.core.parser.ast.IASTScope;
|
||||||
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
|
import org.eclipse.cdt.core.parser.ast.IASTSimpleTypeSpecifier;
|
||||||
|
@ -906,4 +905,15 @@ public class CompleteParseASTTest extends CompleteParseBaseTest
|
||||||
fail();
|
fail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testBug43951() throws Exception
|
||||||
|
{
|
||||||
|
Iterator i = parse( "class B{ B(); ~B(); }; B::B(){} B::~B(){}", false ).getDeclarations();
|
||||||
|
|
||||||
|
IASTClassSpecifier b = (IASTClassSpecifier)((IASTAbstractTypeSpecifierDeclaration)i.next()).getTypeSpecifier();
|
||||||
|
assertEquals( b.getName(), "B");
|
||||||
|
IASTMethod constructor = (IASTMethod) i.next();
|
||||||
|
assertEquals( constructor.getName(), "B" );
|
||||||
|
assertTrue( constructor.previouslyDeclared() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,13 @@
|
||||||
Fixed Bug 43997 : Search results: selection includes preceding whitespace
|
Fixed Bug 43997 : Search results: selection includes preceding whitespace
|
||||||
Fixed Bug 44034 : Scanner failure on #undef
|
Fixed Bug 44034 : Scanner failure on #undef
|
||||||
|
|
||||||
|
2003-10-01 Andrew Niefer
|
||||||
|
bug43951 - search on ctor declarations returns definition too.
|
||||||
|
PST changes:
|
||||||
|
- modify lookupConstructor to copy the constructor list before resolving on it
|
||||||
|
- modify checkUserDefinedConversionSequence the same way
|
||||||
|
- modify isValidFunctionOverload to check for forward declarations
|
||||||
|
|
||||||
2003-10-01 Bogdan Gheorghe
|
2003-10-01 Bogdan Gheorghe
|
||||||
Modified CDT log dump in Parser.fetchToken to include error message
|
Modified CDT log dump in Parser.fetchToken to include error message
|
||||||
|
|
||||||
|
|
|
@ -512,6 +512,12 @@ public class ParserSymbolTable {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//handle forward decls
|
||||||
|
if( origSymbol.getTypeInfo().isForwardDeclaration() &&
|
||||||
|
origSymbol.getTypeSymbol() == newSymbol )
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if( origSymbol.hasSameParameters( newSymbol ) ){
|
if( origSymbol.hasSameParameters( newSymbol ) ){
|
||||||
//functions with the same name and same parameter types cannot be overloaded if any of them
|
//functions with the same name and same parameter types cannot be overloaded if any of them
|
||||||
//is static
|
//is static
|
||||||
|
@ -1473,7 +1479,8 @@ public class ParserSymbolTable {
|
||||||
}
|
}
|
||||||
|
|
||||||
if( container.getConstructors() != null ){
|
if( container.getConstructors() != null ){
|
||||||
constructor = resolveFunction( data, container.getConstructors() );
|
LinkedList constructors = new LinkedList( container.getConstructors() );
|
||||||
|
constructor = resolveFunction( data, constructors );
|
||||||
}
|
}
|
||||||
if( constructor != null && constructor.getTypeInfo().checkBit( TypeInfo.isExplicit ) ){
|
if( constructor != null && constructor.getTypeInfo().checkBit( TypeInfo.isExplicit ) ){
|
||||||
constructor = null;
|
constructor = null;
|
||||||
|
@ -3294,7 +3301,11 @@ public class ParserSymbolTable {
|
||||||
LookupData data = new LookupData( EMPTY_NAME, TypeInfo.t_constructor, null );
|
LookupData data = new LookupData( EMPTY_NAME, TypeInfo.t_constructor, null );
|
||||||
data.parameters = parameters;
|
data.parameters = parameters;
|
||||||
|
|
||||||
return ParserSymbolTable.resolveFunction( data, getConstructors() );
|
List constructors = new LinkedList();
|
||||||
|
if( getConstructors() != null )
|
||||||
|
constructors.addAll( getConstructors() );
|
||||||
|
|
||||||
|
return ParserSymbolTable.resolveFunction( data, constructors );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue