[LLVMbugs] [Bug 20946] New: Cannot multiply a valarray and a single element slice_array
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Mon Sep 15 09:26:34 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=20946
Bug ID: 20946
Summary: Cannot multiply a valarray and a single element
slice_array
Product: libc++
Version: unspecified
Hardware: Macintosh
OS: All
Status: NEW
Severity: normal
Priority: P
Component: All Bugs
Assignee: unassignedclangbugs at nondot.org
Reporter: mclow.lists at gmail.com
CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
Classification: Unclassified
#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;
}
fails to compile, with error:
test.cpp:6:4: error: no viable overloaded '*='
a *= b[std::slice(1,1,1)];
~ ^ ~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/valarray:871:15: note: candidate function not viable: no
known conversion from 'slice_array<value_type>' to 'const value_type'
(aka 'const double') for 1st argument
valarray& operator*= (const value_type& __x);
^
/usr/include/c++/v1/valarray:885:9: note: candidate template ignored: disabled
by 'enable_if' [with _Expr = std::__1::slice_array<double>]
__is_val_expr<_Expr>::value,
^
Compiles with gcc 4.8 and 4.9
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140915/52bcae1f/attachment.html>
More information about the llvm-bugs
mailing list