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
 build 1912 - Create implementation issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

StefanEgo
Ketchup Master

56 Posts

Posted - Aug 09 2012 :  08:58:32 AM  Show Profile  Reply with Quote
Hi,

I just updated to build 1912 and tried to use CreateImplementation on a class which is defined like this:

namespace A
{
class Foo SEALED : public Bar
{
void NewFunc() OVERRIDE;
};
}

OVERRIDE and SEALED are global defines in my project.
#define OVERRIDE override
#define SEALED sealed

using Create implementation onto NewFunc resulted in the following function being added:

void SEALED::NewFunc() OVERRIDE
{
}

I don't recall that a previous build ever had problems with the SEALED-define in that way (but I might be mistaken).

The other problem (OVERRIDE is not removed) is a different thing (as far as I know this has already reported here several times before, so no need to look into this again :) ).

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Aug 10 2012 :  02:11:04 AM  Show Profile  Reply with Quote
I get the same both with 1908 and 1912:

	void A::Foo::NewFunc() OVERRIDE
	{

	}


So we have 2 different problems. Let's tackle why you see different result, first. I'm wondering whether VA is aware of the presence of SEALED on your side.
- What happens if you press alt+G over SEALED? Can you VA take you to the definition?
- Can you please try creating a clear new win32 test project and paste the following into a header file?

namespace A
{
        #define OVERRIDE override
        #define SEALED sealed

	class Bar {};
	class Foo SEALED : public Bar
	{
		void NewFunc() OVERRIDE;
	};

	void Foo::NewFunc() OVERRIDE
	{

	}

}


I did this and SEALED was removed for me.
Go to Top of Page

StefanEgo
Ketchup Master

56 Posts

Posted - Aug 10 2012 :  03:53:59 AM  Show Profile  Reply with Quote
quote:
Originally posted by accord


- What happens if you press alt+G over SEALED? Can you VA take you to the definition?


No it can't. When pressing ALT+G on SEALED nothing happens.

quote:
Originally posted by accord


- Can you please try creating a clear new win32 test project and paste the following into a header file?

namespace A
{
        #define OVERRIDE override
        #define SEALED sealed

	class Bar {};
	class Foo SEALED : public Bar
	{
		void NewFunc() OVERRIDE;
	};

	void Foo::NewFunc() OVERRIDE
	{

	}

}


I did this and SEALED was removed for me.


I assume you meant to copy/paste the code without the definition: void Foo::NewFunc() OVERRIDE {}.
When doing that and using Create Implementation I do get a different result:
(Note that I changed the snippet for newly created functions, hence the ASSERT_UNREACHABLE() line in the method).



Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Aug 11 2012 :  01:11:47 AM  Show Profile  Reply with Quote
quote:
I assume you meant to copy/paste the code without the definition

Yes, sorry. Also, the defines should have been outside the namespace A, but it doesn't seems make any difference regarding the outcome. Anyway, did you used the header file? When you put the source into the header, VA should have placed the implementation to the cpp file.

One more problem is that VA cannot find the definitions of the macros.
- Is the header file (where the macros live) added to your project file?
- Does VA find the file when you press alt+shift+o and type in the filename?
- Does VA find the macro if you type SEALED to the Find symbol dialog? (alt+shift+s)
Go to Top of Page

StefanEgo
Ketchup Master

56 Posts

Posted - Aug 20 2012 :  03:33:27 AM  Show Profile  Reply with Quote
Well I tried the two variations:
- just a single .cpp-file
- added declaration in a .h-file and added an empty .cpp-file -> CreateImplementation then added the following code to the cpp:


void A::SEALED::NewFunc() OVERRIDE
{
	ASSERT_UNREACHABLE("Missing implementation!");
}


I don't get the first question in ur list. The macros are IN THE SAME header file (see code-snipped above and the code u also quoted). It's not in a different header file. The test project only consists of a single .cpp/.h file.
Both files are in the ALT+SHIFT+O-file-list (see screenshot).
Yes it's listed in that box, though there are some invalid entries there (A.SEALED.NewFunc -> should be A.Foo.NewFunc /// A.SEALED -> should be A.Foo).

I sent u the test-project via the support formular so we'r on the same page with the test project at least.









Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Aug 20 2012 :  9:21:21 PM  Show Profile  Reply with Quote
I am seeing the same effect here. However, I was able to "fix" this via turning on recursive macro parsing (which is turned off by default). You can turn it on using the following instructions:

http://docs.wholetomato.com?W363

Regarding override: I have put in a bug report for that:

case=68634
Go to Top of Page

StefanEgo
Ketchup Master

56 Posts

Posted - Aug 21 2012 :  04:14:11 AM  Show Profile  Reply with Quote
In my understanding the setting for parsing recursive macros is only required, if a macro uses another macro as in

#define BAR char*
#define FOO foo(BAR)

In which case the FOO-macro would only be parsed correctly to foo(char*), if recursive macro parsing is enabled.

I don't see why this is required for the case of the SEALED define in the example given above.

I also understand that recursive macro parsing comes at a cost of performance, hence we didn't enable it for us.
Isn't that really reasonable to be consider the presented issue with the SEALED-define as a bug (or feature request) in VAX and assign a case to it?
Honestly I'd rather not enable recursive macro parsing just for the sake of VAX correctly getting a single/simple one-line define right (no offense meant here :) ).

[edit]typo[/edit]

Edited by - StefanEgo on Aug 21 2012 04:15:03 AM
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Aug 21 2012 :  10:02:52 AM  Show Profile  Reply with Quote
Yes, you are right regarding that it is odd that recursive parsing is required. But I had tested it and worked. (it was turned on accidentally in the VS where I tested your problem)
Anyway, yes, this is definitely seems like a bug and I had already put in a bug report for this:

case=68633

I didn't quote it because I though it isn't as important, but your reply proved it otherwise.
Go to Top of Page

accord
Whole Tomato Software

United Kingdom
3277 Posts

Posted - Sep 14 2012 :  1:16:01 PM  Show Profile  Reply with Quote
We found a workaround in the meantime: create va_stdafx.h file in same directory as either the .sln or .proj file with these lines:

#define SEALED sealed

It has helped with the SEALED problem for me, no workaround for the OVERRIDE.

Edited by - accord on Sep 14 2012 3:01:25 PM
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Oct 29 2012 :  11:11:31 AM  Show Profile  Reply with Quote
case=68634 handles the macro-defined override keyword, and is fixed in build 1918
Go to Top of Page

StefanEgo
Ketchup Master

56 Posts

Posted - Oct 31 2012 :  08:38:51 AM  Show Profile  Reply with Quote
nice work ;-) tested and works fine with build 1918
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000