Skip to content

Commit

Permalink
Fix GCC-8 warning: ‘no_unique_address’ attribute directive ignored
Browse files Browse the repository at this point in the history
Signed-off-by: Vladislav Shchapov <vladislav@shchapov.ru>
  • Loading branch information
phprus committed Aug 5, 2022
1 parent b730a93 commit 8aefdf1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions include/gtl/gtl_config.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,12 @@
#define GTL_ATTRIBUTE_FUNC_ALIGN(bytes)
#endif

#if GTL_HAVE_ATTRIBUTE(no_unique_address) || GTL_HAVE_CPP_ATTRIBUTE(no_unique_address)
#define GTL_ATTRIBUTE_NO_UNIQUE_ADDRESS [[no_unique_address]]
#else
#define GTL_ATTRIBUTE_NO_UNIQUE_ADDRESS
#endif

// ----------------------------------------------------------------------
// Figure out SSE support
// ----------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion include/gtl/phmap.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3179,7 +3179,7 @@ class parallel_hash_set
}

EmbeddedSet set_;
[[no_unique_address]] aux_type aux_;
GTL_ATTRIBUTE_NO_UNIQUE_ADDRESS aux_type aux_;
};

private:
Expand Down

0 comments on commit 8aefdf1

Please sign in to comment.