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

            Bug ID: 67554
           Summary: runtime error in valarray (NULL passed to memcpy)
           Product: gcc
           Version: 5.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: terra at gnome dot org
  Target Milestone: ---

Created attachment 36325
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36325&action=edit
Preprocessed source code

# /usr/local/products/gcc/5.2.0/bin/g++ -fsanitize=undefined -D_GLIBCXX_DEBUG
-std=gnu++11 -Wall -Wl,-rpath,/usr/local/products/gcc/5.2.0/lib64 va.C

# ./a.out 
/usr/local/products/gcc/5.2.0/include/c++/5.2.0/bits/valarray_array.h:261:9:
runtime error: null pointer passed as argument 1, which is declared to never be
null
/usr/local/products/gcc/5.2.0/include/c++/5.2.0/bits/valarray_array.h:261:9:
runtime error: null pointer passed as argument 2, which is declared to never be
null


-----------------------------------------------------------------------------

#include <valarray>
#include <array>

int
main ()
{
  std::array<std::valarray<double>,3> foo;
  std::fill(foo.begin(), foo.end(), std::valarray<double>());

  return 0;
}

-----------------------------------------------------------------------------

Reply via email to