[Bug c++/69261] [6 Regression] Copying char arrays during constexpr evaluation does not work reliably

jens.auer at cgi dot com gcc-bugzilla@gcc.gnu.org
Thu Jan 14 11:23:00 GMT 2016


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

--- Comment #4 from Jens Auer <jens.auer at cgi dot com> ---
It produces the correct results if you change foo to not use constexpr:

void foo()
{
   auto const s1 = s( "bla" );
   auto const s2 = s( "blu" );

   string_constexpr<7> const s1s2 = concat(s1,s2);
   auto constexpr c = concat("bla", "blu");
   std::cout << s1.data << std::endl << s2.data << std::endl << s1s2.data <<
std::endl << c << std::endl;
}

$ ./a.out 
bla
blu
blablu
blablu


More information about the Gcc-bugs mailing list