This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28371] New: pointer to function type mistaken when template functions are involved
- From: "joaquin at tid dot es" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jul 2006 15:45:35 -0000
- Subject: [Bug c++/28371] New: pointer to function type mistaken when template functions are involved
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following snippet:
#include <iostream>
void foo(){}
template<typename T>void bar(){}
template<typename T>
void test(const T&)
{
std::cout<<typeid(T).name()<<std::endl;
}
int main()
{
test(&foo);
test(&bar<int>);
}
produces this oputput on gcc version 3.2 20020927
(prerelease) under Cygwin:
PFvvE
FvvE
But the two lines should be identical --in both
cases, the deduced T should be void(*)().
Although it is not immediately apparent in
the testcase provided, what happens is that the
second type is taken as void(), i.e. the pointer
somehow is dropped.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
--
Summary: pointer to function type mistaken when template
functions are involved
Product: gcc
Version: 3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: joaquin at tid dot es
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28371