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
          Reporter: gcc-bugs at marehr dot
  Target Milestone: ---

Created attachment 43552
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.
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
--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)

Reply via email to