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
 1738: no function declarations within functions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

.oisyn
Tomato Guru

162 Posts

Posted - Feb 04 2010 :  10:21:22 AM  Show Profile  Reply with Quote
void Foo()
{
    void Bar();
    Bar();
}

void Bar()
{
}

VAX doesn't understand the declaration of Bar() in Foo(), and that it refers to the Bar() definition further down. It also colors Bar like a variable. Moving the Bar() declaration outside of Foo() makes things work normally again. The C++ standard says that a function declaration within a function declares the function in the enclosing namespace, but is only visible in the current scope.

Also fails in the 1810 beta btw.

accord
Whole Tomato Software

United Kingdom
3287 Posts

Posted - Feb 04 2010 :  2:38:27 PM  Show Profile  Reply with Quote
I am seeing the same effect here. Thank you for the clear description.

case=25957

Out of interest, do you use local function declarations?
Go to Top of Page

.oisyn
Tomato Guru

162 Posts

Posted - Feb 04 2010 :  5:21:38 PM  Show Profile  Reply with Quote
No, not usually. I had to make a quick hack for debugging purposes and so I found out :)
Go to Top of Page

support
Whole Tomato Software

5566 Posts

Posted - Jul 20 2011 :  01:55:09 AM  Show Profile  Reply with Quote
case=25957 is fixed in build 1854

Whole Tomato Software, Inc.
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