Skip to content

Commit

Permalink
Only turn off warning where necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Blake-Madden committed Dec 28, 2023
1 parent fed384c commit 1b50b45
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/i18n_review.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

#include "i18n_review.h"

#ifdef _MSC_VER
# pragma warning(disable : 26478)
#endif

using namespace i18n_string_util;

namespace i18n_check
Expand Down Expand Up @@ -745,8 +741,15 @@ namespace i18n_check
string_info::usage_info{}, fileName,
std::make_pair(std::wstring::npos, std::wstring::npos)));
}
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable : 26478)
#endif
const auto [pos, inserted] =
assignedIds.insert(std::make_pair(idAssignment.second, idAssignment.first));
#ifdef _MSC_VER
# pragma warning(pop)
#endif
if ((m_reviewStyles & check_duplicate_value_assigned_to_ids) && !inserted &&
idAssignment.second.length() &&
// ignore if same ID is assigned to variables with the same name
Expand Down
5 changes: 5 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
// "Don't use std::move on constant variables." false positive in MSVC
// is issued from structured binding assignment.
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable : 26478)
#endif

Expand Down Expand Up @@ -944,3 +945,7 @@ int main(int argc, char* argv[])

return 0;
}

#ifdef _MSC_VER
# pragma warning(pop)
#endif

0 comments on commit 1b50b45

Please sign in to comment.