Open llvmbot opened 9 years ago
sorry, disregard the last entry, I have another bug queued up and mistakenly provided those repro steps.
For this bug std::valarray: navigate to: /libcxx/test/numerics/numarray/template.valarray/valarray.cons
scan-build -k -analyze-headers clang++ -std=c++1y -stdlib=libc++ -g3 -O0 -I/
to repro, navigate to /libcxx/test/numerics/rand/rand.dis/rand.dist.bern
scan-build -k -analyze-headers clang++ -std=c++1y -stdlib=libc++ -g3 -O0 -I/
Please provide more context and/or steps to reproduce.
assigned to @tkremenek
Extended Description
libcxx/include/valarray:841:53: warning: Returning null reference value_type& operator[](sizet i) {return begin[__i];} ^
~~~~~~~ Standard says: N3797 clause: 26.6.2.4 valarray element accessparagraph 6.) If the subscript operator is invoked with a size_t argument whose value is not less than the length of the array, the behavior is undefined.