Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Refactor-rename broken for rvalue references?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jdwiswall
New Member

5 Posts

Posted - Jul 08 2013 :  7:09:25 PM  Show Profile  Reply with Quote
class Foo
{
public:
    Foo() : m_bar(6) { }
    Foo(Foo &&source) : m_bar(std::move(source.m_bar)) {}

    void Quux();

private:
    int m_bar;
};

void Foo::Quux()
{
    m_bar = 10;
}

Next, highlight "m_bar" in Foo::Quux and do "Refactor -> Rename" to "m_zot." Note that the rvalue-refrence version of the constructor was only partially updated; "source.m_bar" remains, should have been "source.m_zot". Here's what I get:

class Foo
{
public:
    Foo() : m_zot(6) { }
    Foo(Foo &&source) : m_zot(std::move(source.m_bar)) {}  // s/b m_zot(std::move(source.m_zot))

    void Quux();

private:
    int m_zot;
};

void Foo::Quux()
{
    m_zot = 10;
}

My posts do not reflect the position of my employer, Microsoft.

feline
Whole Tomato Software

United Kingdom
19022 Posts

Posted - Jul 10 2013 :  10:51:37 AM  Show Profile  Reply with Quote
Which IDE and version of VA are you using?

Using VS2010 and VA 1946, when I trigger Rename on your sample code, VA is finding 5 references. The "source.m_bar" is listed, but with a question mark icon, and it is not ticked by default. So VA has found it, but is not certain that it should be updated.

Are you seeing the same thing on your system?

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000