This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57043] converting overloaded complex function pow in C++11 is ambiguous
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 23 Apr 2013 11:12:21 +0000
- Subject: [Bug c++/57043] converting overloaded complex function pow in C++11 is ambiguous
- Auto-submitted: auto-generated
- References: <bug-57043-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57043
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-04-23
Component|libstdc++ |c++
Known to work| |4.6.3
Ever Confirmed|0 |1
Known to fail| |4.7.3, 4.8.0, 4.9.0
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-04-23 11:12:21 UTC ---
I think this is a front-end issue, the following compiles OK with G++ 4.6,
Clang 3.3 and ICC 13, but not G++ 4.7+ (in c++98 or c++11 mode)
template<typename D> struct complex { };
template<typename Tp>
inline complex<Tp>
pow(const complex<Tp>& x, const complex<Tp>& y)
{ return x; }
template<typename T, typename U>
struct promote_2
{
typedef T type;
};
template<typename Tp, typename Up>
inline complex<typename promote_2<Tp, Up>::type>
pow(const complex<Tp>& x, const complex<Up>& y)
{ return x; }
complex<double> (*powcc)(const complex<double>&, const complex<double>&) = pow;