Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Errorenous '.' to '->' conversion with references

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
rizzuhjj Posted - Feb 07 2007 : 2:32:49 PM
The following test case illustrates incorrect conversion from '.' to '->' when using references to elements in std::vector's or even arrays. This occurs in build 1544, Windows XP SP2, VS2005 SP1.

#include <vector>

struct Foo
{
	int PublicVariable;
};

struct Model
{
	std::vector<Foo> TestVectorMember;
};


int main()
{
	Model model;
	model.TestVectorMember.resize( 2u );
	for (unsigned int i = 0u; i < 2u; ++i)
	{
		Foo& fooRef1 = model.TestVectorMember[i];
		fooRef1-> // <-- "corrected" from '.' to '->'
	}

	std::vector<Foo> testVectorLocal( 2u );
	for (unsigned int i = 0u; i < 2u; ++i)
	{
		Foo& fooRef2 = testVectorLocal[i];
		fooRef2-> // <-- "corrected" from '.' to '->'
	}

	Foo testArray[2];
	for (unsigned int i = 0u; i < 2u; ++i)
	{
		Foo& fooRef3 = testArray[i];
		fooRef3-> // <-- "corrected" from '.' to '->'
	}

	Foo& fooRef4 = testArray[0];
	fooRef4-> // <-- "corrected" from '.' to '->'

	Foo testInstanceLocal;
	for (unsigned int i = 0u; i < 2u; ++i)
	{
		Foo& fooRef5 = testInstanceLocal;
		fooRef5. // <-- kept as dot
	}

	return 0;
}

I have disabled turning dot to -> in the meantime, but hopefully this test case will identify the problem.
8   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 07 2007 : 08:33:06 AM
Currently there are no known problems with having two IDE's open at the same time, using the same code base.

Next time you run into this can you try closing one of the IDE's? Or even both of them, and then just re-load the IDE and solution where you were seeing the problem, and see if this makes any difference?

We recently fixed a problem where having two IDE's open at the same time caused problems, and eventually led to VA's symbol database becoming corrupt. I was able to reproduce the initial problems, but not the corrupt symbol database step. For me closing the two IDE's and then only opening one of them fixed the problem.

If this is caused by the two IDE's then you might see a similar behaviour.
rhummer Posted - Jul 06 2007 : 10:45:09 AM
Hm, well after some playing around, I cleaned out my DB cache, the issue is gone for now. Though I suspect it will show up again. I often have two IDE's open with the same code base, though one IDE has some different code, since I have a big refactoring job going on with one. So the second IDE is the current version in our depot. So I can check features and see why my stuff isn't working vs what is working.

Unfortunately I cannot reproduce this in a simple test solution, I don't know if it's something with our code base, which is ~1 million lines of code, or the two IDE's confuses the DB after a while or something.

I'll update if I can find any more info.
kevinsikes Posted - Jul 06 2007 : 01:45:15 AM
rhummer,

I tested 1557 with a configuration identical to yours (except for the DirectX include path) using this code:

class Foo
{
public:
	int nAge;
	char* lpszName;
	Foo& GetThis() { return *this; }
};

void Bar(Foo& ref)
{
	ref.lpszName = "Andromeda"; // . was left alone
}

void main()
{
	Foo* pFoo = new Foo;
	Foo &myref = pFoo->GetThis(); // . was correctly converted to ->
	myref.nAge = 2; // . was left alone
	pFoo->GetThis().lpszName = "Capricorn"; // first . converted to ->, second left alone
}

The behavior was normal. I also tried with const references; it still worked OK. I also tested with the original example posted in this case, and the behavior was normal as well. Do you have a minimal example project that exhibits this behavior that you could send us? It would also help if I had your VA X settings exported from the Performance node in the VA X options dialog. Thanks!

VA_X.dll file version 10.3.1557.0 built 2007.05.29
Licensed to:
VA X: ***************
VAOpsWin.dll version 1.3.2.2
VATE.dll version 1.0.5.6
DevEnv.exe version 8.0.50727.762
msenv.dll version 8.0.50727.762
Font: Bitstream Vera Sans Mono 13(Pixels)
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
2 processors

Platform: Win32
Stable Includes:
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\include;
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\include;
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\PlatformSDK\\include;
c:\\Program Files\\Microsoft Visual Studio 8\\SDK\\v2.0\\include;

Library Includes:
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfc;
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfcm;
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\atl;
c:\\Program Files\\Microsoft Visual Studio 8\\VC\\crt\\src;

Other Includes:

rhummer Posted - Jul 05 2007 : 5:49:37 PM
I'm still seeing this same kind of issue using 1557, and earlier builds.

Pretty much 100% of the time I type '.' on a reference to an object, be it a const reference or non-const, it will convert it to a '->'

some examples:
// using a const reference
const Foo &foobar = myObject->GetFoo();
foobar.Something(); // I type '.', I get an '->'

// using a const reference as an argument
void SomeMethod( const Foo &foo )
{
     foo.Something(); // Same issue.
}

// calling a method directly from the returned referance
myObject->GetFoo().Something(); // Hitting '.' after GetFoo(), puts an '->'


It's not just me either, nearly everyone I've talked to where I work sees the same issue. Most have disabled this feature, since it causes headaches.

VA X Info:
VA_X.dll file version 10.3.1557.0 built 2007.05.29
Licensed to:
VA X: XXX
VAOpsWin.dll version 1.3.2.2
VATE.dll version 1.0.5.6
DevEnv.exe version 8.0.50727.762
msenv.dll version 8.0.50727.762
Font: Courier New 13(Pixels)
Comctl32.dll version 6.0.2900.2982
Windows XP 5.1 Build 2600 Service Pack 2
2 processors

Platform: Custom
Stable Includes:
C:\\Program Files\\Microsoft DirectX SDK (August 2006)\\Include;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\include;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\include;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\PlatformSDK\\include;
C:\\Program Files\\Microsoft Visual Studio 8\\SDK\\v2.0\\include;

Library Includes:
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfc;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\mfcm;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\atlmfc\\src\\atl;
C:\\Program Files\\Microsoft Visual Studio 8\\VC\\crt\\src;

Other Includes:

support Posted - Mar 17 2007 : 4:06:54 PM
Case 4795 is fixed in build 1549.
feline Posted - Feb 23 2007 : 3:52:43 PM
I have increased the priority on this bug for you, hopefully this will help a bit. For now the work around is to either disable this feature of VA, use backspace to undo the conversion, or to initialize the reference with something else.
daves Posted - Feb 22 2007 : 6:00:58 PM
This is also biting me hard. Its erroneously converting . to -> almost every time. I also had to disable the feature in frustration. I hope a fix for this is released quickly, my support expires soon.
feline Posted - Feb 08 2007 : 09:31:33 AM
I am seeing the same effect here. Thank you for the clear description.

Pressing backspace after the dot has been converted to -> undoes this conversion. Alternatively if you initialise the reference using something other than an array item then this does not happen.

case=4795

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