Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Refactor-rename broken for rvalue references?

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
jdwiswall Posted - Jul 08 2013 : 7:09:25 PM
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;
}
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 10 2013 : 10:51:37 AM
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?

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000