mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
bug 88460
This commit is contained in:
parent
5a64d3581a
commit
594abda89f
2 changed files with 17 additions and 6 deletions
|
@ -3002,4 +3002,13 @@ public class AST2Tests extends AST2BaseTest {
|
||||||
assertTrue( col.getName(2).isDeclaration() );
|
assertTrue( col.getName(2).isDeclaration() );
|
||||||
assertFalse( col.getName(2).isReference() );
|
assertFalse( col.getName(2).isReference() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void test88460() throws Exception {
|
||||||
|
IASTTranslationUnit tu = parse( "void f();", ParserLanguage.C ); //$NON-NLS-1$
|
||||||
|
CNameCollector col = new CNameCollector();
|
||||||
|
tu.accept( col );
|
||||||
|
|
||||||
|
IFunction f = (IFunction) col.getName(0).resolveBinding();
|
||||||
|
assertFalse( f.isStatic() );
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -27,7 +27,6 @@ import org.eclipse.cdt.core.dom.ast.IParameter;
|
||||||
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
import org.eclipse.cdt.core.dom.ast.IProblemBinding;
|
||||||
import org.eclipse.cdt.core.dom.ast.IScope;
|
import org.eclipse.cdt.core.dom.ast.IScope;
|
||||||
import org.eclipse.cdt.core.dom.ast.IType;
|
import org.eclipse.cdt.core.dom.ast.IType;
|
||||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPASTFunctionDeclarator;
|
|
||||||
import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator;
|
import org.eclipse.cdt.core.dom.ast.gnu.c.ICASTKnRFunctionDeclarator;
|
||||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||||
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
import org.eclipse.cdt.core.parser.util.CharArrayUtils;
|
||||||
|
@ -93,7 +92,7 @@ public class CFunction implements IFunction, ICInternalBinding {
|
||||||
if( tu != null ){
|
if( tu != null ){
|
||||||
CPPVisitor.getDeclarations( tu, this );
|
CPPVisitor.getDeclarations( tu, this );
|
||||||
}
|
}
|
||||||
declarators = (ICPPASTFunctionDeclarator[]) ArrayUtil.trim( ICPPASTFunctionDeclarator.class, declarators );
|
declarators = (IASTStandardFunctionDeclarator[]) ArrayUtil.trim( IASTStandardFunctionDeclarator.class, declarators );
|
||||||
bits |= FULLY_RESOLVED;
|
bits |= FULLY_RESOLVED;
|
||||||
bits &= ~RESOLUTION_IN_PROGRESS;
|
bits &= ~RESOLUTION_IN_PROGRESS;
|
||||||
}
|
}
|
||||||
|
@ -312,10 +311,13 @@ public class CFunction implements IFunction, ICInternalBinding {
|
||||||
|
|
||||||
|
|
||||||
IASTFunctionDeclarator dtor = definition;
|
IASTFunctionDeclarator dtor = definition;
|
||||||
IASTDeclSpecifier declSpec = ((IASTFunctionDefinition)dtor.getParent()).getDeclSpecifier();
|
IASTDeclSpecifier declSpec = null;
|
||||||
if( declSpec.getStorageClass() == IASTDeclSpecifier.sc_static ){
|
if( dtor != null ){
|
||||||
bits |= 3 << 2;
|
declSpec = ((IASTFunctionDefinition)dtor.getParent()).getDeclSpecifier();
|
||||||
return true;
|
if( declSpec.getStorageClass() == IASTDeclSpecifier.sc_static ){
|
||||||
|
bits |= 3 << 2;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for( int i = 0; i < declarators.length; i++ ){
|
for( int i = 0; i < declarators.length; i++ ){
|
||||||
|
|
Loading…
Add table
Reference in a new issue