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
 Feature Requests
 throw(...)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Jul 15 2007 :  9:39:28 PM  Show Profile  Reply with Quote
This is a valid function declaration in C++:
void Foo() throw(...) {}


However, when typing the dots you get this (build 1555):
throw(..->)


Quite irritating, yes

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jul 16 2007 :  03:59:04 AM  Show Profile  Reply with Quote
no it's not:)
void Foo() throw() {}
is. and it's a definition not a declaration:P

http://www.mf-sd.de
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 16 2007 :  08:03:36 AM  Show Profile  Reply with Quote
For now I am going to avoid getting into semantics

znakeeye which IDE are you using?
Are you typing in a header file or a cpp file?
How easily can you reproduce this problem? Does typing speed seem to be a factor?

This bug should have been fixed a while ago now. We have had a few reports of this since then, but so far I have never been able to reproduce this problem.

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

kevinsikes
Tomato Guru

USA
271 Posts

Posted - Jul 16 2007 :  3:22:47 PM  Show Profile  Reply with Quote
catch(...) is a valid construct, are you seeing the problem with catch as well?

Kevin Sikes
Infotainment Platform Design Engineer
Ford Motor Company
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Jul 17 2007 :  10:52:08 AM  Show Profile  Reply with Quote
Sidenote: bugfix, throw(...) is indeed correct syntax.

IDE = VS 2005 SP1
VAX = 10.3.1557 (sorry, not 1555 as mentioned above)
Typing speed is not a factor. In fact, if I hold down '.' I get this:
throw(..->->->->->->->->->->->->->->

Hope this helps.
Go to Top of Page

znakeeye
Tomato Guru

379 Posts

Posted - Jul 17 2007 :  11:00:33 AM  Show Profile  Reply with Quote
Oh, I forgot...
catch(...) works as expected.
Go to Top of Page

bugfix
Tomato Guru

Germany
324 Posts

Posted - Jul 17 2007 :  11:51:38 AM  Show Profile  Reply with Quote
according to ISOIEC14882-2003 15.4 Exception specifications it's not. you can specify a type_id list and ... is certainly not one.

http://www.mf-sd.de
Go to Top of Page

mwb1100
Ketchup Master

82 Posts

Posted - Jul 17 2007 :  2:46:13 PM  Show Profile  Reply with Quote
quote:
Originally posted by bugfix

according to ISOIEC14882-2003 15.4 Exception specifications it's not. you can specify a type_id list and ... is certainly not one.



"throw(...)" as an exception specification is a Microsoft extension.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 17 2007 :  3:28:48 PM  Show Profile  Reply with Quote
For me this code compiles quite happily in a cpp file in VS2005:

void Foo() throw(...) {}


since it compiles we probably need to support it, at least slightly

znakeeye if I hold down the dot key when typing this I get:

void Foo() throw(..................) {}

I have checked on two different machines, and get the same result on both. And yes, I do have convert dot to -> turned on, I checked

If you create a new, default console project do you still see this problem? I am trying to work out what could be triggering this in such a reliable manor on your machine.

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

znakeeye
Tomato Guru

379 Posts

Posted - Jul 18 2007 :  01:15:20 AM  Show Profile  Reply with Quote
Darn, it does indeed work in a console project. And to make things worse I can't reproduce it in my other project. In this MFC project I'm using this 3rd-party library from Codejock: Xtreme ToolkitPro. I believe I have seen posts here before, related to issues when using this particular library. Perhaps the error is in their code?
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 18 2007 :  08:11:51 AM  Show Profile  Reply with Quote
Xtreme ToolkitPro rings vague bells, but off hand I don't remember any major problems with this library.

Which IDE are you using? They offer different evaluation packages for different IDE's, so I probably need to download the package for the IDE you are using:

http://www.codejock.com/downloads/

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

znakeeye
Tomato Guru

379 Posts

Posted - Jul 18 2007 :  4:38:47 PM  Show Profile  Reply with Quote
I actually found it! The problem only occurs if some conditions are forfilled:


CMyClass::~CMyClass()
{
   // LUA_API void       (lua_close) (lua_State *L);
   lua_close(m_state);
}

void CMyClass::Foo() throw(..->


Thus, the sequence of tokens is something like this:
1) Class destructor
2) A call to lua_close() in the destructor, or in a class function below it.
3) Function declaration with throw(...) = BOOM!

I think this could be a general bug that could lead to problems in other cases. It's something about that lua_close() function. The full source can be found at www.lua.org.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Jul 18 2007 :  5:56:37 PM  Show Profile  Reply with Quote
Thank you for your investigations. I have never heard of or used Lua, so I downloaded version 5.1 tar ball and extracted it locally. I then added the following code to a header file:

#include "C:\\lua-5.1\\src\\lua.h"

class CTestLuaDots
{
	CTestLuaDots();
	~CTestLuaDots();
	void Foo() throw(...);
};

void CTestLuaDots::Foo() throw(...) { }


Note that I have not added Lua to the project include directories, or to the VA stable include directories. Using this test code I am not seeing any problems typing throw(...)

Are you able to reproduce this problem by adding your test code to a test console project.

zen is the art of being at one with the two'ness
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