Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1430: static_cast in define

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
Rasmuss Posted - Nov 11 2005 : 09:12:55 AM
When using static_cast in a define "go to" stops working for functions in the inherited class:


class TestBase
{
public:
	void TestBaseFunction();
};

class Test : public TestBase
{
public:
	void TestFunction();
};

extern class TestBase* g_pTestBase;

#define TESTBASE g_pTestBase
#define TESTNOSTATIC_CAST (Test*)TESTBASE
#define TEST (static_cast<Test*>(TESTBASE))
TESTBASE->TestBaseFunction(); // Works. Goes to definition of TestBaseFunction
TEST->TestBaseFunction(); // Works. Goes to definition of TestBaseFunction
TESTNOSTATIC_CAST->TestFunction(); // Works. Goes to definition of TestFunction
TEST->TestFunction(); // Doesn't work, just goes to define

#define TESTBASE2 (static_cast<TestBase*>(g_pTestBase))
#define TEST2NOSTATIC_CAST (Test*)(g_pTestBase)
#define TEST2 static_cast<Test*>(g_pTestBase)
TESTBASE2->TestBaseFunction(); // Works. Goes to definition of TestBaseFunction
TEST2->TestBaseFunction(); // Works. Goes to definition of TestBaseFunction
TEST2NOSTATIC_CAST->TestFunction(); // Works. Goes to definition of TestFunction
TEST2->TestFunction(); // Doesn't work, just goes to define


I've tried this on some colleagues machines who have older versions of VA:

VA.NET 7.1.1106 works
VAX 10.1.1297.0 works

Regards,
Rasmus Sigsgaard
7   L A T E S T    R E P L I E S    (Newest First)
support Posted - Apr 14 2006 : 1:17:15 PM
Fixed in build 1445.
support Posted - Mar 12 2006 : 3:44:52 PM
case 876 is fixed in our forthcoming beta build. (Probably the next general release as well.)
feline Posted - Mar 08 2006 : 3:46:16 PM
sorry, currently no progress to report on this. i have put a note on the case asking for this to be looked at fairly soon, but i am not sure when this will happen.
Rasmuss Posted - Mar 08 2006 : 04:27:05 AM
Any news on this? Even though I've myself reverted to 1418, I have a lot of colleagues who are now using the newest version, since we just bought a new 45 user license.
feline Posted - Nov 19 2005 : 2:54:10 PM
that makes sense. i have updated the case with this, so hopefully all of them will be fixed at the same time.
Rasmuss Posted - Nov 18 2005 : 04:03:03 AM
I just tried the rest of the casting operators and none of them work.


#define TESTDYNAMIC (dynamic_cast<Test*>(TESTBASE))
#define TESTREINTERPRET (reinterpret_cast<Test*>(TESTBASE))
#define TESTCONST (const_cast<Test*>(TESTBASE))
TESTDYNAMIC->TestFunction(); // Doesn't work, just goes to define
TESTREINTERPRET->TestFunction(); // Doesn't work, just goes to define
TESTCONST->TestFunction(); // Doesn't work, just goes to define


Regards,
Rasmus
feline Posted - Nov 15 2005 : 4:37:10 PM
thank you for the clear example, reproduced in VS 2003 C++ with VA 1432

case=876

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