Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Goto base class broken when 'using' construct

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
tony.riviere Posted - Feb 18 2020 : 04:45:07 AM
Hello,
The goto declaration (Alt+G) fails if there is a using of the base class constructor. The goto declaration goes to the using statement instead of the base class declaration.
Here is a small snippet:

class Base
{};

class Derived : public Base
{
    using Base::Base;
};

  • Put your cursor on the "Base" of "public Base"
  • Press Alt+G

Cursor before goto:

Cursor after goto:
4   L A T E S T    R E P L I E S    (Newest First)
tony.riviere Posted - Feb 19 2020 : 07:31:55 AM
Indeed, it works.
feline Posted - Feb 19 2020 : 05:20:56 AM
In this simple test case, I have added this code above the base class:

#ifdef VA_HELPER_CODE
#define USING_BASE_CLASS
#else
#define USING_BASE_CLASS using BaseClassWithUsing::BaseClassWithUsing;
#endif


and inside the Derived class I have replaced the using statement with:

USING_BASE_CLASS;

which has fixed the problem for me. Can you try the same workaround on your code and see if this works correctly?
tony.riviere Posted - Feb 19 2020 : 03:45:32 AM
I have quite some classes which are "using" the base class constructors.
As workaround, I'm using the IntelliSense goto which is working in this case.
feline Posted - Feb 18 2020 : 10:49:26 AM
I am seeing the same effect here. Thank you for the clear description.

case=141905

Do you often encounter this problem, or is it something that only comes up very occasionally?

It should be possible to "hide" the using statement from VA's parser with some careful #define statements, but if this is only a very rare problem it may not be worth the fuss.

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