mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32:10 +02:00
fix bug 86543
This commit is contained in:
parent
593f2ec013
commit
17879a2974
2 changed files with 18 additions and 7 deletions
|
@ -2558,5 +2558,22 @@ public class AST2CPPTests extends AST2BaseTest {
|
|||
assertInstances( col, i, 2 );
|
||||
assertInstances( col, p, 3 );
|
||||
}
|
||||
|
||||
public void testBug86543() throws Exception {
|
||||
StringBuffer buffer = new StringBuffer();
|
||||
buffer.append("int printf( const char *, ... ); \n"); //$NON-NLS-1$
|
||||
buffer.append("void foo(){ \n"); //$NON-NLS-1$
|
||||
buffer.append(" int a, b; \n"); //$NON-NLS-1$
|
||||
buffer.append(" printf( \"hello\" ); \n"); //$NON-NLS-1$
|
||||
buffer.append(" printf(\"a=%d b=%d\", a, b ); \n"); //$NON-NLS-1$
|
||||
buffer.append("} \n"); //$NON-NLS-1$
|
||||
|
||||
IASTTranslationUnit tu = parse(buffer.toString(), ParserLanguage.CPP);
|
||||
CPPNameCollector col = new CPPNameCollector();
|
||||
tu.getVisitor().visitTranslationUnit(col);
|
||||
|
||||
IFunction printf = (IFunction) col.getName(6).resolveBinding();
|
||||
assertInstances( col, printf, 3 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1484,8 +1484,6 @@ public class CPPSemantics {
|
|||
source = getSourceParameterType( sourceParameters, j );
|
||||
if( source == null )
|
||||
continue outer;
|
||||
if( source instanceof IProblemBinding )
|
||||
return (IBinding) source;
|
||||
|
||||
if( j < numTargetParams ){
|
||||
if( targetLength == 0 && j == 0 ){
|
||||
|
@ -1502,11 +1500,7 @@ public class CPPSemantics {
|
|||
if( varArgs ){
|
||||
cost = new Cost( source, null );
|
||||
cost.rank = Cost.ELLIPSIS_CONVERSION;
|
||||
} /*else if ( target.getHasDefault() && source.isType( ITypeInfo.t_void ) && !source.hasPtrOperators() ){
|
||||
//source is just void, ie no parameter, if target had a default, then use that
|
||||
cost = new Cost( source, target );
|
||||
cost.rank = Cost.IDENTITY_RANK;
|
||||
}*/ else if( source.equals( target ) ){
|
||||
} else if( source.equals( target ) ){
|
||||
cost = new Cost( source, target );
|
||||
cost.rank = Cost.IDENTITY_RANK; //exact match, no cost
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue