Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 rvalue parsing issue

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
Barktroll Posted - Apr 30 2016 : 10:13:36 AM
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!
4   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Jul 18 2016 : 10:39:23 PM
case=96952 is fixed in build 2107.
feline Posted - May 04 2016 : 6:37:00 PM
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?
Barktroll Posted - May 02 2016 : 12:51:05 PM
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).
feline Posted - May 02 2016 : 12:37:53 PM
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?

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