Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring: Use NOEXCEPT for swap methods #6682

Merged
merged 1 commit into from
Aug 11, 2024
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
3 changes: 0 additions & 3 deletions cppcheckpremium-suppressions
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,6 @@ premium-misra-cpp-2023-18.1.1
# TODO do not throw token pointer?
premium-misra-cpp-2023-18.3.2:lib/tokenize.cpp

# TODO use noexcept
premium-misra-cpp-2023-18.4.1

# in smallvector we intentionally put a constant above some preprocessor includes
premium-misra-cpp-2023-19.0.3:lib/smallvector.h

Expand Down
2 changes: 1 addition & 1 deletion lib/checkleakautovar.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class CPPCHECKLIB VarInfo {
referenced.erase(varid);
}

void swap(VarInfo &other) {
void swap(VarInfo &other) NOEXCEPT {
alloctype.swap(other.alloctype);
possibleUsage.swap(other.possibleUsage);
conditionalAlloc.swap(other.conditionalAlloc);
Expand Down
2 changes: 1 addition & 1 deletion lib/programmemory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void ProgramMemory::erase_if(const std::function<bool(const ExprIdToken&)>& pred
}
}

void ProgramMemory::swap(ProgramMemory &pm)
void ProgramMemory::swap(ProgramMemory &pm) NOEXCEPT
{
mValues.swap(pm.mValues);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/programmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ struct CPPCHECKLIB ProgramMemory {

void erase_if(const std::function<bool(const ExprIdToken&)>& pred);

void swap(ProgramMemory &pm);
void swap(ProgramMemory &pm) NOEXCEPT;

void clear();

Expand Down
2 changes: 1 addition & 1 deletion lib/valueptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class CPPCHECKLIB ValuePtr {
return get();
}

void swap(ValuePtr& rhs) {
void swap(ValuePtr& rhs) NOEXCEPT {
using std::swap;
swap(mPtr, rhs.mPtr);
swap(mClone, rhs.mClone);
Expand Down
Loading