Skip to content

Commit

Permalink
Fixed Visual Studio compiler warning
Browse files Browse the repository at this point in the history
Replaced
    #if defined(__GNUC__)
by
    #if defined(__GNUC__) || defined(__clang__)
  • Loading branch information
jrade committed Nov 26, 2024
1 parent 357f783 commit cc04c56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/gtl/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1311,12 +1311,12 @@ class vector {
impl_.e_ += n;
} else {
if constexpr (std::is_trivially_copyable_v<T> && usingStdAllocator) {
#if defined(__GNUC__)
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wnonnull" // disable erroneous warning
#endif
std::memmove((void*)(position + n), (void*)position, tail * sizeof(T));
#if defined(__GNUC__)
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
impl_.e_ += n;
Expand Down

0 comments on commit cc04c56

Please sign in to comment.