Bug 399203 - Extract Local Variable incorrectly extracts expression with enumeration constant
Summary: Extract Local Variable incorrectly extracts expression with enumeration constant
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-refactoring (show other bugs)
Version: 8.2   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-27 17:17 EST by Farnaz Behrang CLA
Modified: 2020-09-04 15:22 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Farnaz Behrang CLA 2013-01-27 17:17:30 EST
In the following program...
==========
int main (int argc, char *argv[])
{
  enum { Z, F } func = Z; //select func=Z
  return 0;
}

==========

If you select 'func=Z', and invoke the Extract Local Variable refactoring, program throws the following exception:

Caused by: java.lang.ClassCastException: org.eclipse.cdt.internal.core.dom.parser.c.CNodeFactory cannot be cast toorg.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)
	.
	.
	.