See test suite at http://d3dgraphicspipeline.codeplex.com/releases/view/39824
typedef void (Bar::*MethodPtr)(int);
MethodPtr Method4(int x)
{
MethodPtr member;
if (x < 0)
{
// #TEST#: EM4 Extract Method on next line
// #TEST#: EM20 Extract Method on rhs of assignment
member = &Bar::Operation1;
}
else
{
member = &Bar::Operation2;
}
return member;
}
Extract Method EM20 produces:
typedef void (Bar::*MethodPtr)(int);
MethodPtr Method4(int x)
{
MethodPtr member;
if (x < 0)
{
// #TEST#: EM4 Extract Method on next line
// #TEST#: EM20 Extract Method on rhs of assignment
member = MyMethod();
}
else
{
member = &Bar::Operation2;
}
return member;
}
void MyMethod()
{
return &Bar::Operation1;
}