https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84684
Bug ID: 84684 Summary: inserting random code / flags produces wrong code Product: gcc Version: 7.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: gcc-bugs at marehr dot dialup.fu-berlin.de Target Milestone: --- Created attachment 43552 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43552&action=edit static_assert's throw even though they should not Hi gcc-team, I'm really sorry for this really bad title, but I really don't know what is going on and what the cause is. When I compile the attached code it produces on my machine incorrect results which is tested via static_asserts. When I add some code or add some compiler flags a different static_assert throws. Also on different environment (e.g. travis-ci, our build system,...) this code throws at different places. There is also the possibility that it does not throw at all which would be my expectation. I have different states of the reduced source code if this one does not work for you. > g++ -std=c++17 -Wall -Werror -fconcepts -o > union_composition_detail_test.cpp.o -c union_composition_detail_test.cpp I even encountered states where the flags did not have any influence and the problem persisted, but I ran more frequently in this issue with those flags. The only observation I had was that `value_to_char[i] = alphabet.assign_rank(i).to_char();` seems to always work, but it might be a coincidence. Thank you! > g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: /build/gcc/src/gcc/configure --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=https://bugs.archlinux.org/ --enable-languages=c,c++,ada,fortran,go,lto,objc,obj-c++ --enable-shared --enable-threads=posix --enable-libmpx --with-system-zlib --with-isl --enable-__cxa_atexit --disable-libunwind-exceptions --enable-clocale=gnu --disable-libstdcxx-pch --disable-libssp --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --with-linker-hash-style=gnu --enable-gnu-indirect-function --enable-multilib --disable-werror --enable-checking=release --enable-default-pie --enable-default-ssp Thread model: posix gcc version 7.3.0 (GCC)