This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/9183: typenames in foreign namespaces inhibit member function template argument deduction
- From: klfd21 at yahoo dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 6 Jan 2003 11:39:46 -0000
- Subject: c++/9183: typenames in foreign namespaces inhibit member function template argument deduction
- Reply-to: klfd21 at yahoo dot de
>Number: 9183
>Category: c++
>Synopsis: typenames in foreign namespaces inhibit member function template argument deduction
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Mon Jan 06 03:46:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Martin Wille
>Release: 3.0.4, 3.1, 3.2
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
Compiling the attached code snippet with gcc-3 results
in this error message:
deduction.cpp: In function `void xxx::fun(const int&)': deduction.cpp:10: no matching function for call to `xxx::yyy::filter(const int&)'
gcc-2.95.3 compiles the code fine.
Without the first line the code can be compiled by gcc-3.
Explicitely provided template arguments work well
(i.e. replacing line 10 by
void fun(int const &t) { yyy::template filter<int>(t); }
).
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="deduction.cpp"
Content-Disposition: inline; filename="deduction.cpp"
namespace unused { struct filter {}; }
namespace xxx
{
struct yyy
{
template <typename T>
static T const & filter(T const &t) { return t; }
};
void fun(int const &t) { yyy::filter(t); }
}
int
main()
{
}