c++/9437: template function parameter `T*' shouldn't match pointers to members
bangerth@dealii.org
bangerth@dealii.org
Fri Jan 24 20:54:00 GMT 2003
Synopsis: template function parameter `T*' shouldn't match pointers to members
State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Fri Jan 24 20:12:59 2003
State-Changed-Why:
Something's indeed wrong here. To see what the template
parameter matches, execute the following variation:
-------------------------
extern "C" void printf (const char *, ...);
struct S {
template <typename T>
operator T* () const {
printf ("%s\n", __PRETTY_FUNCTION__);
return static_cast<T*> (0);
}
} null;
struct A { int i; };
static void f (int A::* pmi) { }
int main () { f (null); }
-----------------------------
It displays
g/a> /home/bangerth/bin/gcc-3.4-pre/bin/c++ x.cc
g/a> ./a.out
S::operator T*() const [with T = int A::*]
But then the return type would be _pointer_ to member
pointer, not member pointer.
Confirmed with 2.95, 3.2.2, 3.3, 3.4
W.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9437
More information about the Gcc-bugs
mailing list