c++/276: using declaration inside templates are ignored.

sxking@uswest.net sxking@uswest.net
Mon Jun 5 00:26:00 GMT 2000


>Number:         276
>Category:       c++
>Synopsis:       using declaration inside templates are ignored.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon Jun 05 00:26:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     sxking@uswest.net
>Release:        gcc version 2.96 20000604 (experimental)
>Organization:
>Environment:
redhat 6.2 on intel PII
>Description:
using declarations inside templates are ignored, but work for
specializations or overloads.
>How-To-Repeat:
namespace std
{
   float sqrt (float);
   double sqrt (double);
   long double sqrt (long double);
}


template < typename T >
T
foo (T const &t)
{
   using std::sqrt;

   return sqrt (t); // results in error msg 'sqrt' undeclared
 }

float
foo (float const &f)
{
   using std::sqrt;
   return sqrt(f);
}

template double foo (double const &);

template<>
long double
foo (long double const &l)
{
   using std::sqrt;
   return sqrt (l);
}

int
main ()
{
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the Gcc-prs mailing list