Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 Check for emptiness produces invalid code

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
Breany Posted - Jan 04 2018 : 10:40:24 AM
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;
  }
};
2   L A T E S T    R E P L I E S    (Newest First)
sean Posted - Feb 21 2018 : 5:50:58 PM
case=112036 is fixed in build 2258
feline Posted - Jan 04 2018 : 2:19:08 PM
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.

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