Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/check.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ class CPPCHECKLIB Check {
instances().remove(this);
}

Check(const Check &) = delete;
Check& operator=(const Check &) = delete;

/** List of registered check classes. This is used by Cppcheck to run checks and generate documentation */
static std::list<Check *> &instances();

Expand Down Expand Up @@ -159,9 +162,6 @@ class CPPCHECKLIB Check {
*/
bool wrongData(const Token *tok, const char *str);

/** disabled assignment operator and copy constructor */
void operator=(const Check &) = delete;
Check(const Check &) = delete;
private:
const std::string mName;
};
Expand Down
7 changes: 3 additions & 4 deletions lib/checkio.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ class CPPCHECKLIB CheckIO : public Check {
ArgumentInfo(const Token *arg, const Settings *settings, bool _isCPP);
~ArgumentInfo();

ArgumentInfo(const ArgumentInfo &) = delete;
ArgumentInfo& operator= (const ArgumentInfo &) = delete;

bool isArrayOrPointer() const;
bool isComplexType() const;
bool isKnownType() const;
Expand All @@ -91,10 +94,6 @@ class CPPCHECKLIB CheckIO : public Check {
bool _template;
bool address;
bool isCPP;

private:
ArgumentInfo(const ArgumentInfo &); // not implemented
ArgumentInfo operator = (const ArgumentInfo &); // not implemented
};

void checkFormatString(const Token * const tok,
Expand Down
7 changes: 4 additions & 3 deletions lib/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,13 @@ class CPPCHECKLIB Timer {
public:
Timer(const std::string& str, SHOWTIME_MODES showtimeMode, TimerResultsIntf* timerResults = nullptr);
~Timer();

Timer(const Timer&) = delete;
Timer& operator=(const Timer&) = delete;

void stop();

private:
Timer(const Timer& other); // disallow copying
Timer& operator=(const Timer&); // disallow assignments

const std::string mStr;
TimerResultsIntf* mTimerResults;
std::clock_t mStart;
Expand Down
7 changes: 3 additions & 4 deletions lib/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,10 @@ class CPPCHECKLIB Token {
private:
TokensFrontBack* mTokensFrontBack;

// Not implemented..
Token(const Token &);
Token operator=(const Token &);

public:
Token(const Token &) = delete;
Token& operator=(const Token &) = delete;

enum Type {
eVariable, eType, eFunction, eKeyword, eName, // Names: Variable (varId), Type (typeId, later), Function (FuncId, later), Language keyword, Name (unknown identifier)
eNumber, eString, eChar, eBoolean, eLiteral, eEnumerator, // Literals: Number, String, Character, Boolean, User defined literal (C++11), Enumerator
Expand Down
10 changes: 3 additions & 7 deletions lib/tokenlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class CPPCHECKLIB TokenList {
explicit TokenList(const Settings* settings);
~TokenList();

TokenList(const TokenList &) = delete;
TokenList &operator=(const TokenList &) = delete;

void setSettings(const Settings *settings) {
mSettings = settings;
}
Expand Down Expand Up @@ -192,13 +195,6 @@ class CPPCHECKLIB TokenList {
bool isKeyword(const std::string &str) const;

private:

/** Disable copy constructor, no implementation */
TokenList(const TokenList &);

/** Disable assignment operator, no implementation */
TokenList &operator=(const TokenList &);

void determineCppC();

/** Token list */
Expand Down
7 changes: 3 additions & 4 deletions test/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ class options {

const std::string& exe() const;

private:
options();
options(const options& non_copy);
const options& operator =(const options& non_assign);
options() = delete;
options(const options&) = delete;
options& operator =(const options&) = delete;

private:
std::set<std::string> mWhichTests;
Expand Down