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
 rvalue parsing issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Barktroll
New Member

7 Posts

Posted - Apr 30 2016 :  10:13:36 AM  Show Profile  Reply with Quote
I seem to have stumbled upon a parsing issue in VAX 2094 and VS2015 with the following code:

int main(int argc, char* argv[])
{
    char numbers = {0, 1, 2, 3};
    for(auto&& number : numbers)
    {
    }
}




As you can see in the image, the variable 'number' isn't getting highlighted. It's white instead of the silver color that the other variables have. If I switch out the list to be a list of structs with members, I don't get any dot-completion suggestions either, leading me to believe it's more than just a highlighting issue.

I should probably note that I'm running VS2015 with "Disable Database" set to "True" in "Options -> Text Editor -> C/C++ -> Advanced", meaning I don't have any sort of IntelliSense (or semantic colorization), but am instead solely relying on VAX. I should maybe also note that I have VAX set to "Source of C/C++ content: Visual Assist".

Thank you for an otherwise amazing product!

feline
Whole Tomato Software

United Kingdom
15984 Posts

Posted - May 02 2016 :  12:37:53 PM  Show Profile  Reply with Quote
I don't recognise the syntax you are using here, always something new to learn. So the first thing I did was add this function to an existing VS2015 Update 2 C++ project, but it does not compile.

I then added it to a new C++ console project, and it still does not compile. I am getting the error message:

too many initializer values

on your

char numbers = {0, 1, 2, 3};

line. I am also getting an error on the for loop. Should this code actually compile, if so, what do I need to do to make this happen?

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

Barktroll
New Member

7 Posts

Posted - May 02 2016 :  12:51:05 PM  Show Profile  Reply with Quote
Well, that's embarrassing. I was a bit too quick to type this up, so I didn't even bother compiling it. The code should of course be:

int main()
{
    char numbers[] = {0, 1, 2, 3};
    for(auto&& number : numbers)
    {
    }
}




But as you can see - the problem remains. The real issue seems to be the usage of the auto rvalue reference syntax. If I change the for-loop type to be char, everything of course parses just fine, and same if I just do an auto lvalue reference, or straight-up auto for that matter.

And again, this is only when disabling semantic colorization in the Visual Studio options (which gets disabled automatically when disabling IntelliSense altogether).
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
15984 Posts

Posted - May 04 2016 :  6:37:00 PM  Show Profile  Reply with Quote
Ah, that makes a lot more sense. The for loop syntax is interesting, and a lot more compact. I did wonder what was happening for the char variable, now I see.

I am seeing the same problem here, thank you for the clear example:

case=96952

and I am also seeing the problem with the array of struct, instead of the array of char.

For now, turning the IDE intellisense database back on is the only work around I can suggest. Is there a particular reason you have turned this off?

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

sean
Whole Tomato Software

USA
2641 Posts

Posted - Jul 18 2016 :  10:39:23 PM  Show Profile  Reply with Quote
case=96952 is fixed in build 2107.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2019 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000