Community
Participate
Working Groups
In the following program... ========== int main(){ enum { EN1 = 0, EN2, } enum_var; enum_var = -1; //select statement without ; return 0; } ========== If you select enum_var = -1 (on line 5), and invoke the Extract Function refactoring, CDT throws the ClassCast Exception. Part of the trace: [ERROR] java.lang.ClassCastException: org.eclipse.cdt.internal.core.dom.parser.c.CNodeFactory cannot be cast to org.eclipse.cdt.core.dom.ast.cpp.ICPPNodeFactory at org.eclipse.cdt.internal.core.dom.rewrite.DeclarationGeneratorImpl.getName(DeclarationGeneratorImpl.java:332) at org.eclipse.cdt.internal.core.dom.rewrite.DeclarationGeneratorImpl.getDeclSpecForBinding(DeclarationGeneratorImpl.java:324) at org.eclipse.cdt.internal.core.dom.rewrite.DeclarationGeneratorImpl.createDeclSpecFromType(DeclarationGeneratorImpl.java:112) at org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExpressionExtractor.determineReturnType(ExpressionExtractor.java:103) at org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring.getReturnType(ExtractFunctionRefactoring.java:681) at org.eclipse.cdt.internal.ui.refactoring.extractfunction.ExtractFunctionRefactoring.addMethod(ExtractFunctionRefactoring.java:603) ... ...