[cfe-dev] Looks lie a bug: no implicit conversion from slice_array to valarray in 3.4.1 + libcpp

Marshall Clow mclow.lists at gmail.com
Mon Sep 15 09:38:17 PDT 2014


On Sep 12, 2014, at 9:43 AM, Lev Serebryakov <lev at FreeBSD.org> wrote:

> Hello, Cfe-dev.
> 
> I'm using clang 3.4.1 (FreeBSD-CURRENT system compiler) with
> I'm compile very simple program, which uses <valarray>. Of course, it is
> test case, I found this bug when try to compile qucs project on this system
> 

> 
> ============ test.cpp
> #include <valarray>
> 
> int main(int argc, char *argv[]) {
>        std::valarray<double> a(4, 10);
>        std::valarray<double> b(4, 20);
>        a *= b[std::slice(1,1,1)];
>        return 0;
> }
> =====================


I’ve opened issue http://llvm.org/bugs/show_bug.cgi?id=20946 to track this.

I’m not sure if this is a bug in libc++, or an extension in libstdc++.
A quick look at the standard doesn’t show any implicit conversions from a single-element slice array (the result of 'b[std::slice(1,1,1)]’) to a double.

Thanks for the report.

— Marshall





More information about the cfe-dev mailing list