Skip to content

Commit

Permalink
gcc10 being weird?!
Browse files Browse the repository at this point in the history
  • Loading branch information
marehr committed Mar 3, 2021
1 parent c1a7441 commit afbbc26
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/seqan3/alphabet/alphabet_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,17 @@ class alphabet_base
*/
SEQAN3_DEPRECATED_310 static constexpr rank_type char_to_rank_table(char_type const chr) noexcept
{
#if SEQAN3_WORKAROUND_GCC_99318
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
using index_t = std::make_unsigned_t<char_type>;
index_t const id = static_cast<index_t>(chr);
return derived_type::char_to_rank[id];
# pragma GCC diagnostic pop
#else // ^^^ workaround / no workaround vvv
using index_t = std::make_unsigned_t<char_type>;
return derived_type::char_to_rank[static_cast<index_t>(chr)];
#endif // SEQAN3_WORKAROUND_GCC_99318
}

public:
Expand Down
9 changes: 9 additions & 0 deletions include/seqan3/core/platform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,15 @@
# endif
#endif

//!\brief See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99318
#ifndef SEQAN3_WORKAROUND_GCC_99318 // not yet fixed, this is a regression since gcc-10
# if defined(__GNUC__) && (__GNUC__ >= 10)
# define SEQAN3_WORKAROUND_GCC_99318 1
# else
# define SEQAN3_WORKAROUND_GCC_99318 0
# endif
#endif

/*!\brief This is needed to support CentOS 7 or RHEL 7; Newer CentOS's include a more modern default-gcc version making
* this macro obsolete.
*
Expand Down

0 comments on commit afbbc26

Please sign in to comment.