This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/84684] inserting random code / flags produces wrong code


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84684

--- Comment #6 from gcc-bugs at marehr dot dialup.fu-berlin.de ---
I use now a more simpler approach for the fold expression [1], but the problem
from this bug ticket still persisted when I used the same kind of assignment:

        for (size_t i = 0u; i < alphabet_t::value_size; ++i) {
            value_to_char[i] = to_char(alphabet.assign_rank(i));
        }

Extracting the rhs into a external lambda function

        auto assign_rank_to_char = [](auto alphabet, size_t rank) constexpr
        {
            return seqan3::to_char(seqan3::assign_rank(alphabet, rank));
        };

        ...

        for (size_t i = 0u; i < alphabet_t::value_size; ++i) {
            value_to_char[i] = assign_rank_to_char(alphabet, i);
        }

Seems to resolve the problem for me and our build systems. I'm eager to know
which edge case I triggered here :)

[1]
https://github.com/marehr/seqan3/blob/0aa304d9a4bc81eb52dd144f3da5fd38330408fc/include/seqan3/alphabet/composition/union_composition.hpp#L362-L389

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]