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
 Check for emptiness produces invalid code
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Breany
New Member

8 Posts

Posted - Jan 04 2018 :  10:40:24 AM  Show Profile  Reply with Quote
VA_X.dll file version 10.9.2237.0 built 2017.10.03
DevEnv.exe version 14.0.25420.1 Professional
msenv.dll version 14.0.25425.1
Comctl32.dll version 6.10.7601.18837
Windows 7 6.1 Build 7601 Service Pack 1
8 processors (x86-64, WOW64)
Language info: 1252, 0x409

Given the code:
#include <vector>
class tester : public std::vector<int>
{
public:
  int something()
  {
    if (size() > 0)
      return 1;
    return 0;
  }
};


Code inspection will say to check emptiness with empty() instead of size(), producing the following code:
#include <vector>
class tester : public std::vector<int>
{
public:
  int something()
  {
    if (!size->empty())
      return 1;
    return 0;
  }
};

Expected results:
#include <vector>
class tester : public std::vector<int>
{
public:
  int something()
  {
    if (!empty())
      return 1;
    return 0;
  }
};

feline
Whole Tomato Software

United Kingdom
18750 Posts

Posted - Jan 04 2018 :  2:19:08 PM  Show Profile  Reply with Quote
Thank you for the clear example, this is something we are aware of and are hoping to have a fix for this fairly soon:

case=112036

For now, are you aware that if you use undo, Alt-Backspace, this will undo the code inspection fix.

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

sean
Whole Tomato Software

USA
2817 Posts

Posted - Feb 21 2018 :  5:50:58 PM  Show Profile  Reply with Quote
case=112036 is fixed in build 2258
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