[Bug c++/35255] New: gcc does not do partial ordering on overloaded address resolution
jason at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Feb 19 22:20:00 GMT 2008
The following reduced testcase from PR 34950 gives an incorrect error after the
crashing bug in that PR is fixed:
-----
struct default_policy {};
template <class T = default_policy>
struct policy
{
typedef int precision_type;
};
template <class Real, class Policy> struct precision {
typedef Real type;
typedef typename Policy::precision_type precision_type;
};
template <class T1, class T2, class Policy>
struct bessel_traits {
typedef T1 result_type;
typedef typename precision<result_type, Policy>::type precision_type;
};
template <class Fn>
void
def(char const* name, Fn fn);
template <class T1, class T2, class Policy>
typename bessel_traits<T1, T2, Policy>::result_type
cyl_bessel_j(T1 v, T2 x, const Policy& pol);
template <class T1, class T2>
typename bessel_traits<T1, T2, policy<> >::result_type
cyl_bessel_j(T1 v, T2 x);
void hedge_expose_polynomial()
{
def("cyl_bessel_j", cyl_bessel_j<int, double>);
}
-----
We should recognize that the latter template is more specialized than the
former, and so the implicit address of cyl_bessel_j<int, double> is
unambiguous.
--
Summary: gcc does not do partial ordering on overloaded address
resolution
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: rejects-valid
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jason at gcc dot gnu dot org
BugsThisDependsOn: 34950
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35255
More information about the Gcc-bugs
mailing list