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
 OVERRIDE macro not removed from impl
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sneftel
Junior Member

Ireland
24 Posts

Posted - Nov 20 2013 :  04:54:20 AM  Show Profile  Reply with Quote
When a member function declaration is marked override, the override is removed from the implementation by "Create Implementation".

In our codebase, though, we use an OVERRIDE macro instead (to support older compilers which use different keywords or don't have the feature). This macro is copied to the implementation, causing a compile error.

It's not a huge problem, but you might consider stripping macro identifiers depending on their expansion. (I could see this happening with static or virtual, for instance.)

Edited by - sneftel on Nov 20 2013 04:54:38 AM

sean
Whole Tomato Software

USA
2817 Posts

Posted - Nov 20 2013 :  10:21:59 AM  Show Profile  Reply with Quote
OVERRIDE was supposed to have been fixed in build 1918 (case=68634). A quick test here shows that it is removed. If you are using build 1918 or higher, then could you please post sample code where OVERRIDE is being inserted with the implementation?
Go to Top of Page

sneftel
Junior Member

Ireland
24 Posts

Posted - Nov 20 2013 :  12:15:14 PM  Show Profile  Reply with Quote
Sure. This is build 1940, BTW.

#define HK_OVERRIDE override

struct Foo
{
	virtual void foo();
};

struct Bar : public Foo
{
	void foo() HK_OVERRIDE;
};


Right click Bar::foo, "Create Implementation". The following is added:


void Bar::foo() HK_OVERRIDE
{

}

Edited by - sneftel on Nov 20 2013 12:16:55 PM
Go to Top of Page

sean
Whole Tomato Software

USA
2817 Posts

Posted - Nov 20 2013 :  12:49:48 PM  Show Profile  Reply with Quote
Thanks for the example. Since OVERRIDE != HK_OVERRIDE it's clear why the fix for 68634 has no effect in your codebase.
I've opened a bug for this (case=78572).
Go to Top of Page

sneftel
Junior Member

Ireland
24 Posts

Posted - Nov 21 2013 :  05:00:52 AM  Show Profile  Reply with Quote
Ah, I see... the literal macro name OVERRIDE was special-cased. Makes sense.
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