<html>
<head>
<base href="http://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Cannot multiply a valarray and a single element slice_array"
href="http://llvm.org/bugs/show_bug.cgi?id=20946">20946</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Cannot multiply a valarray and a single element slice_array
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>#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</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>