diff --git a/lib/check.h b/lib/check.h index 9bacd584dae..a8fcd62f28f 100644 --- a/lib/check.h +++ b/lib/check.h @@ -88,7 +88,7 @@ class CPPCHECKLIB Check { const std::string& name() const & { return mName; } - const std::string& name() && { + std::string name() && { return mName; } diff --git a/lib/checkunusedvar.cpp b/lib/checkunusedvar.cpp index 7f442a5a1d3..64d05f33a5e 100644 --- a/lib/checkunusedvar.cpp +++ b/lib/checkunusedvar.cpp @@ -150,7 +150,7 @@ class Variables { const std::map &varUsage() const & { return mVarUsage; } - const std::map &varUsage() && { + std::map varUsage() && { return mVarUsage; } void addVar(const Variable *var, VariableType type, bool write_); diff --git a/lib/errorlogger.h b/lib/errorlogger.h index a601ad09145..cc8120729bb 100644 --- a/lib/errorlogger.h +++ b/lib/errorlogger.h @@ -96,7 +96,7 @@ class CPPCHECKLIB ErrorMessage { return mInfo; } - const std::string& getinfo() && { + std::string getinfo() && { return mInfo; } @@ -189,7 +189,7 @@ class CPPCHECKLIB ErrorMessage { return mShortMessage; } - const std::string &shortMessage() && { + std::string shortMessage() && { return mShortMessage; } @@ -199,7 +199,7 @@ class CPPCHECKLIB ErrorMessage { return mVerboseMessage; } - const std::string &verboseMessage() && { + std::string verboseMessage() && { return mVerboseMessage; } @@ -208,7 +208,7 @@ class CPPCHECKLIB ErrorMessage { return mSymbolNames; } - const std::string &symbolNames() && { + std::string symbolNames() && { return mSymbolNames; } diff --git a/lib/filesettings.h b/lib/filesettings.h index f5968938cce..22046416878 100644 --- a/lib/filesettings.h +++ b/lib/filesettings.h @@ -50,7 +50,7 @@ class FileWithDetails return mPath; } - const std::string& path() && + std::string path() && { return mPath; } @@ -59,7 +59,7 @@ class FileWithDetails { return mPathSimplified; } - const std::string& spath() && + std::string spath() && { return mPathSimplified; } diff --git a/lib/library.cpp b/lib/library.cpp index d18a4c289b3..8cc0562d84a 100644 --- a/lib/library.cpp +++ b/lib/library.cpp @@ -91,13 +91,13 @@ struct Library::LibraryData const std::string& start() const & { return mStart; } - const std::string& start() && { + std::string start() && { return mStart; } const std::string& end() const & { return mEnd; } - const std::string& end() && { + std::string end() && { return mEnd; } int offset() const { diff --git a/lib/suppressions.cpp b/lib/suppressions.cpp index fd958432c27..a5509001931 100644 --- a/lib/suppressions.cpp +++ b/lib/suppressions.cpp @@ -522,7 +522,7 @@ const std::list &SuppressionList::getSuppressions( return mSuppressions; } -const std::list &SuppressionList::getSuppressions() && +std::list SuppressionList::getSuppressions() && { return mSuppressions; } diff --git a/lib/suppressions.h b/lib/suppressions.h index e29234890ae..2e8288226a6 100644 --- a/lib/suppressions.h +++ b/lib/suppressions.h @@ -55,7 +55,7 @@ class CPPCHECKLIB SuppressionList { const std::string &getFileName() const& { return mFileName; } - const std::string &getFileName() && { + std::string getFileName() && { return mFileName; } int lineNumber; @@ -245,7 +245,7 @@ class CPPCHECKLIB SuppressionList { * @return list of suppressions */ const std::list &getSuppressions() const&; - const std::list &getSuppressions() &&; + std::list getSuppressions() &&; /** * @brief Marks Inline Suppressions as checked if source line is in the token stream diff --git a/lib/symboldatabase.h b/lib/symboldatabase.h index 37e63d81647..d4f9ae5109f 100644 --- a/lib/symboldatabase.h +++ b/lib/symboldatabase.h @@ -537,7 +537,7 @@ class CPPCHECKLIB Variable { const std::vector &dimensions() const& { return mDimensions; } - const std::vector &dimensions() && { + std::vector dimensions() && { return mDimensions; } @@ -1379,9 +1379,7 @@ class CPPCHECKLIB SymbolDatabase { const std::vector & variableList() const& { return mVariableList; } - const std::vector & variableList() && { - return mVariableList; - } + std::vector variableList() &&; // Unimplemented by intention; Not safe to use this on temporary object /** * @brief output a debug message diff --git a/lib/templatesimplifier.h b/lib/templatesimplifier.h index 322f1285ea6..ede9e8a6813 100644 --- a/lib/templatesimplifier.h +++ b/lib/templatesimplifier.h @@ -53,7 +53,7 @@ class CPPCHECKLIB TemplateSimplifier { const std::string& dump() const & { return mDump; } - const std::string& dump() && { + std::string dump() && { return mDump; } @@ -175,19 +175,19 @@ class CPPCHECKLIB TemplateSimplifier { const std::string & scope() const & { return mScope; } - const std::string & scope() && { + std::string scope() && { return mScope; } const std::string & name() const & { return mName; } - const std::string & name() && { + std::string name() && { return mName; } const std::string & fullName() const & { return mFullName; } - const std::string & fullName() && { + std::string fullName() && { return mFullName; } const Token * nameToken() const { diff --git a/lib/token.h b/lib/token.h index 9d40f73c6a1..ba1b100cb8c 100644 --- a/lib/token.h +++ b/lib/token.h @@ -206,7 +206,7 @@ class CPPCHECKLIB Token { const std::string &str() const & { return mStr; } - const std::string &str() && { + std::string str() && { return mStr; } diff --git a/lib/tokenlist.h b/lib/tokenlist.h index 0dac6549dc5..bfba0f5cd8b 100644 --- a/lib/tokenlist.h +++ b/lib/tokenlist.h @@ -142,7 +142,7 @@ class CPPCHECKLIB TokenList { const std::vector& getFiles() const & { return mFiles; } - const std::vector& getFiles() && { + std::vector getFiles() && { return mFiles; } diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 3838f5aed49..26af0c5055b 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -1532,14 +1532,14 @@ struct SingleValueFlowAnalyzer : ValueFlowAnalyzer { const std::unordered_map& getVars() const & { return varids; } - const std::unordered_map& getVars() && { + std::unordered_map getVars() && { return varids; } const std::unordered_map& getAliasedVars() const & { return aliases; } - const std::unordered_map& getAliasedVars() && { + std::unordered_map getAliasedVars() && { return aliases; }