Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 build 1912 - Create implementation issue

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
StefanEgo Posted - Aug 09 2012 : 08:58:32 AM
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 :) ).
10   L A T E S T    R E P L I E S    (Newest First)
StefanEgo Posted - Oct 31 2012 : 08:38:51 AM
nice work ;-) tested and works fine with build 1918
support Posted - Oct 29 2012 : 11:11:31 AM
case=68634 handles the macro-defined override keyword, and is fixed in build 1918
accord Posted - Sep 14 2012 : 1:16:01 PM
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.
accord Posted - Aug 21 2012 : 10:02:52 AM
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.
StefanEgo Posted - Aug 21 2012 : 04:14:11 AM
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]
accord Posted - Aug 20 2012 : 9:21:21 PM
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
StefanEgo Posted - Aug 20 2012 : 03:33:27 AM
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.









accord Posted - Aug 11 2012 : 01:11:47 AM
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)
StefanEgo Posted - Aug 10 2012 : 03:53:59 AM
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).



accord Posted - Aug 10 2012 : 02:11:04 AM
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.

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