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
 1635: returning result of overloaded operator
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

o2a
Junior Member

24 Posts

Posted - Apr 23 2008 :  5:58:30 PM  Show Profile  Reply with Quote
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.

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Apr 24 2008 :  1:46:40 PM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
19021 Posts

Posted - Apr 28 2008 :  09:31:14 AM  Show Profile  Reply with Quote
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.

zen is the art of being at one with the two'ness
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - May 13 2008 :  2:47:14 PM  Show Profile  Reply with Quote
case=16345 is fixed in build 1638
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