public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/13554] New: static_cast fails in Boost.Math library
@ 2004-01-03 11:54 john at johnmaddock dot co dot uk
2004-01-03 12:07 ` [Bug c++/13554] " pinskia at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: john at johnmaddock dot co dot uk @ 2004-01-03 11:54 UTC (permalink / raw)
To: gcc-bugs
I have a corner case where a static cast fails if the target type has an
explicit constructor, the case is abstacted from the Boost.Math library, and
compiles OK with VC++7.1 and EDG-frontend compilers, the failure seems to be a
regression from previous gcc releases:
namespace boost{
template<typename T, template<typename> class U>
U<T> test(const U<T>& t)
{
U<T> x = static_cast<U<T> >(1);
return t + x;
}
namespace nested{
template <class T>
struct numeric
{
numeric(){ m_value = 0; }
explicit numeric(T t){ m_value = t; }
T value()const { return m_value; }
private:
T m_value;
};
template <class T>
numeric<T> operator+(const numeric<T>& a, const numeric<T>& b)
{
return numeric<T>(a.value() + b.value());
}
}
}
int main()
{
boost::nested::numeric<double> num(2);
boost::test(num);
return 0;
}
--
Summary: static_cast fails in Boost.Math library
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: john at johnmaddock dot co dot uk
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13554
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/13554] static_cast fails in Boost.Math library
2004-01-03 11:54 [Bug c++/13554] New: static_cast fails in Boost.Math library john at johnmaddock dot co dot uk
@ 2004-01-03 12:07 ` pinskia at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-01-03 12:07 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-01-03 12:07 -------
Fixed for 3.3.2, and 3.4.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |3.3.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13554
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-01-03 12:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-03 11:54 [Bug c++/13554] New: static_cast fails in Boost.Math library john at johnmaddock dot co dot uk
2004-01-03 12:07 ` [Bug c++/13554] " pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).