This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/28414] New: return type of valarray's sqrt function isn't valarray
- From: "djg at cray dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 17 Jul 2006 23:22:06 -0000
- Subject: [Bug libstdc++/28414] New: return type of valarray's sqrt function isn't valarray
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The return type of valarray's sqrt function isn't valarray, as specified in
26.3.3.3 [lib.valarray.transcend], and what it does return doesn't convert to
valarray in some cases. This causes the slice1.cpp example from the Josuttis
book examples to get a compile error:
http://www.josuttis.com/libbook/num/slice1.cpp.html
g++ gives this error:
slice1.cpp:48: error: no matching function for call to
?printValarray(std::_Expr<std::_UnClos<std::__sqrt, std::_ValArray, double>,
double>)?
Here's a reduced form which still shows the error:
#include <valarray>
using namespace std;
template<class T>
void printValarray (const valarray<T>& va);
void foo(void)
{
valarray<double> v;
printValarray (sqrt(v));
}
--
Summary: return type of valarray's sqrt function isn't valarray
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: djg at cray dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28414