[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Hello,
Apologies for the long post.
I want goto labels be defined in different function then the goto was
called in (our language compiler supports non-local branching in this
kind). Goto <label_name> can be called in one translation unit, while
the “label_name:” may be located in another one.
Currently in CDT clicking F3 on the “label_name” in the following
example (both functions are in the same TU):
it foo(){
label_name:
….
}
int Boo(){
…
goto label_name;
…
}
Gives the following error:
java.lang.ClassCastException:
org.eclipse.cdt.internal.core.dom.parser.c.CASTTypedefNameSpecifier
cannot be cast to
org.eclipse.cdt.core.dom.ast.cpp.ICPPASTDeclSpecifier
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.findDeclarationOwner(CPPVisitor.java:2062)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.findNameOwner(CPPVisitor.java:2038)
at org.eclipse.cdt.internal.core.dom.parser.ProblemBinding.getOwner(ProblemBinding.java:249)
at org.eclipse.cdt.internal.core.dom.parser.cpp.semantics.CPPVisitor.getQualifiedName(CPPVisitor.java:1898)
at org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsJob.removeSecondaryBindings(OpenDeclarationsJob.java:635)
at org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsJob.navigationFallBack(OpenDeclarationsJob.java:596)
at org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsJob.runOnAST(OpenDeclarationsJob.java:232)
at org.eclipse.cdt.internal.core.model.ASTCache.runOnAST(ASTCache.java:221)
at org.eclipse.cdt.internal.ui.editor.ASTProvider.runOnAST(ASTProvider.java:344)
at org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsJob.performNavigation(OpenDeclarationsJob.java:136)
at org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsJob.run(OpenDeclarationsJob.java:112)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
I thought that the workaround to my problem will be to insert the
lable_name to the AST as external variable and not as labeled
statement. What do you think?
Thank you,
David