Hello,
I have a code smell identified by SonarCFamily I don’t know how to deal with.
Initially, I have the following code :
class A {
public:
A() {};
~A() { /* Important things to do (no resources management) */ };
};
One bug (S3624) and one code smell (S4963) are then identified. I understand I have a choice to do for performance reasons (according to About sonar cloud C++11 constructor rule Is it BUG?).
So, I try to solve them with the following code :
class A {
public:
A() {};
~A() { /* Important things to do (no resources management) */ };
A(const A&) = delete;
A& operator=(const A&) = delete;
A(A&&) = delete;
A& operator=(A&&) = delete;
};
Despite of this modification, I still have one code smell (S4963).
Is there a way or a general strategy to solve this kind of code smell ? Or is it just a warning to draw my attention to a performance issue that I need to think about and assume it ?
Thanks.
Developer Edition Version 8.0 (build 29455)
Code Analyzer for C, C++, Objective-C : SonarCFamily 6.7.0 (build 15300)