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
 Goto base class broken when 'using' construct
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

tony.riviere
Ketchup Master

France
58 Posts

Posted - Feb 18 2020 :  04:45:07 AM  Show Profile  Reply with Quote
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:

feline
Whole Tomato Software

United Kingdom
19061 Posts

Posted - Feb 18 2020 :  10:49:26 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

tony.riviere
Ketchup Master

France
58 Posts

Posted - Feb 19 2020 :  03:45:32 AM  Show Profile  Reply with Quote
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.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19061 Posts

Posted - Feb 19 2020 :  05:20:56 AM  Show Profile  Reply with Quote
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?

zen is the art of being at one with the two'ness
Go to Top of Page

tony.riviere
Ketchup Master

France
58 Posts

Posted - Feb 19 2020 :  07:31:55 AM  Show Profile  Reply with Quote
Indeed, it works.
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