1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

2005-07-26 Alain Magloire

Fix PR 100992: IMethod were generated for implementation, we should generate
	IFunction for method defines outside of the class shell.
	* model/org/eclipse/cdt/internal/core/model/CModelBuilder.java
This commit is contained in:
Alain Magloire 2005-07-26 19:50:35 +00:00
parent 9bc8ef7164
commit 6ca469c8d4
2 changed files with 20 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2005-07-26 Alain Magloire
Fix PR 100992: IMethod were generated for implementation, we should generate
IFunction for method defines outside of the class shell.
* model/org/eclipse/cdt/internal/core/model/CModelBuilder.java
2005-07-22 Alain Magloire
Fix PR 104908
* plugin.xml

View file

@ -19,6 +19,8 @@ import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IParent;
import org.eclipse.cdt.core.model.IProblemRequestor;
import org.eclipse.cdt.core.model.IStructure;
import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.cdt.core.parser.CodeReader;
import org.eclipse.cdt.core.parser.ExtendedScannerInfo;
import org.eclipse.cdt.core.parser.IParser;
@ -689,7 +691,7 @@ public class CModelBuilder {
FunctionDeclaration element = null;
if( functionDeclaration instanceof IASTMethod )
if( functionDeclaration instanceof IASTMethod && parent instanceof IStructure)
{
IASTMethod methodDeclaration = (IASTMethod) functionDeclaration;
MethodDeclaration methodElement = null;
@ -734,6 +736,18 @@ public class CModelBuilder {
}
else // instance of IASTFunction
{
if (parent instanceof ITranslationUnit) {
String[] names = functionDeclaration.getFullyQualifiedName();
StringBuffer buf = new StringBuffer();
for (int i = 0; i < names.length; ++i) {
if (buf.length() != 0) {
buf.append("::"); //$NON-NLS-1$
}
buf.append(names[i]);
}
name = buf.toString();
}
FunctionDeclaration functionElement = null;
if (functionDeclaration.hasFunctionBody())
{