Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Renaming scoped class selects unrelated identifier

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
legalize Posted - Jun 22 2014 : 1:41:32 PM
Test suite: http://d3dgraphicspipeline.codeplex.com/releases/view/39824

Test case R7

Renaming class X::Rename1 causes instances of ::Rename1 to be selected, generating invalid code.
4   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Jul 17 2014 : 12:22:49 AM
I am seeing the same effect here, now I know what I am looking for:

case=27398
legalize Posted - Jul 16 2014 : 11:10:06 AM
Ah, I see the problem now. Instances of ::Rename1 are selected for renaming where they are used later in the file.



legalize Posted - Jul 16 2014 : 11:01:08 AM
In the linked test suite, file Rename.cpp, ::Rename1 is located between lines 24 and 45. X::Rename1 is located between lines 56 and 77. Test case R7 is on line 55.

However, I am unable to reproduce the issue right now in VS2012.
feline Posted - Jul 15 2014 : 10:05:44 PM
I don't understand what you mean here. I cannot find the "::Rename1" in the test suite that is supposed to be being updated. I have checked the link, and it says the project has not been updated since 2010, so I should have the correct version.

Trying to guess what you are describing, I have tested with the following code in a .cpp file:

class testClassDuplicateName
{
public:
	static void useGlobalClass()	{ }
};

namespace testSpaceHoldingDuplicate
{
	class testClassDuplicateName
	{
		void useSpaceClass()	{ }
	};

	void testCallingGlobalClass()
	{
		::testClassDuplicateName::useGlobalClass();
	}
}

and so far I am not seeing any obvious problems. This code compiles quite happily, and has more distinct names to avoid any accidental problems with duplicate names.

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