Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 1635: returning result of overloaded operator

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
o2a Posted - Apr 23 2008 : 5:58:30 PM
Hi,

there seems to be a problem with parsing code using overloaded operators if it follows a return-statement. It doesn't matter if the overloaded operator is a member or a free standing function.

struct Test
{
	Test operator-(Test const &other) {return other;}
	Test test2(Test const &other) {return other;}
	int  test() {return 0;}
};

Test operator+(Test const &t1, Test const &t2) {return t1;}

int main()
{
	Test t1,t2;
	
	(t1-t2).test(); // ok
	(t1+t2).test(); // ok
	t1.test2(t2).test(); // ok, but wrong additionally members listed

	return (t1-t2).test(); // result of operator not recognized
	return (t1+t2).test(); // result of operator not recognized
	
	return t1.test2(t2).test(); // ok, but wrong additionally members listed
}


The effect in the example is that I don't get a member listbox when typing return (t1-t2). and the test() in return (t1-t2).test(); is no recognized by VAX.

The problem is not there if you use regular functions instead of overloaded operators. But interestingly I get another problem there, independent if after a return or not:


As you can see, there are 4 wrong members listed. They come from two different classes in the boost::functional-header which is completely unrelated and not used anywhere in the test-project. (Hmm, after opening that boost-header just now, VAX added a 5th wrong member to the list, named computed().)

I'm quite sure, that both problems are regressions but I can't remember which versions got it right before.
3   L A T E S T    R E P L I E S    (Newest First)
support Posted - May 13 2008 : 2:47:14 PM
case=16345 is fixed in build 1638
feline Posted - Apr 28 2008 : 09:31:14 AM
I have just put in a bug report for the function being underlined as a mistyped symbol:

case=16345

The unexpected items in the listbox, I still cannot reproduce. I will have a look at that when you tell me which boost header file the symbols come from.
feline Posted - Apr 24 2008 : 1:46:40 PM
I have reproduced half of this. I am seeing the underlining, but not the unexpected items in the listboxes. There is no underlining in VA 1561.

Which boost header file are they coming from? So far I am not seeing any sign of this boost header / class / item in Boost 1.33.1

Which version of Boost are you using? I suspect these extra items are triggered by VA having parsed the relevant boost headers at some point.

I would like to reproduce all of this before putting in a bug report, in case the boost headers are a factor.

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