Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

Failed compile when removing a function out of a class

LegacyForum
LegacyForum Posts: 1,664 ✭✭
(Entered for David Mann)

I added a function inside AdjacentChannels called BlaBla(). I added it to the .h and .cpp. The .cpp portion is just an empty function. I added a call inside the constructor of the ThreadBase class AdjChannel.BlaBla().
I built the code using GenerateUnitTests followed by GenerateStubs followed by Run Unit Tests - Report Unresolved. That made a new auto_incomplete function (see issue 3). I then attempted to remove that same function out. I then built the code using GenerateUnitTests followed by GenerateStubs and got the following error:
"c:\Mydata\Uav\Build\Visual C++\Ofp\Main\stubs\autogenerated\auto_incomplete_feb3fefc.cpp", line 15: error:
class "AdjacentChannels" has no member "CppTest_Auto_Stub_BlaBla"
int (::AdjacentChannels::CppTest_Auto_Stub_BlaBla) (void)
^
Process exited with code: 1 (error).
...failed.
"Generate Stubs" (Execution) for UAV\MAIN finished with error(s). Examine the log above for details.
Is this normal behavior? If so, does that mean it is up to the user to physically remove all references to deleted functions from the auto_incomplete*.* code. I believe that if auto generation can add function could it not be made to remove functions as well. What is the reasoning behind this? If concerned about code loss maybe commenting out the code automatically would be sufficent.