From mboxrd@z Thu Jan 1 00:00:00 1970 From: nathan@gcc.gnu.org To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, ibn@ut.ee, nobody@gcc.gnu.org Subject: Re: c++/3448: class method as parameter Date: Sun, 08 Jul 2001 09:31:00 -0000 Message-id: <20010708163145.1767.qmail@sourceware.cygnus.com> X-SW-Source: 2001-07/msg00203.html List-Id: Synopsis: class method as parameter State-Changed-From-To: open->closed State-Changed-By: nathan State-Changed-When: Sun Jul 8 09:31:45 2001 State-Changed-Why: gcc 3.0 reports 3448.C: In function `int a(int)': 3448.C:28: warning: control reaches end of non-void function 3448.C: In function `int b(int)': 3448.C:34: warning: control reaches end of non-void function 3448.C: In function `int superf(int (*)(int))': 3448.C:39: warning: control reaches end of non-void function 3448.C: In member function `int X::csuperf(int (X::*)(int))': 3448.C:43: `6' cannot be used as a member pointer, since it is of type `int' 3448.C:44: warning: control reaches end of non-void function 3448.C: At global scope: 3448.C:46: syntax error before `:' token 3448.C:49: ISO C++ forbids declaration of `printf' with no type 3448.C:49: `int printf' redeclared as different kind of symbol /usr/include/stdio.h:254: previous declaration of `int printf(const char*, ...)' 3448.C:49: cannot convert `const char*' to `int' in initialization 3448.C:50: parse error before `}' token 3448.C:52: syntax error before `:' token 3448.C:55: ISO C++ forbids declaration of `printf' with no type 3448.C:55: redefinition of `int printf' 3448.C:49: `int printf' previously defined here 3448.C:55: cannot convert `const char*' to `int' in initialization 3448.C:56: parse error before `}' token the error of significance is on line 43. A pointer to member is invoked by (obj.*ptr) (args) or (obj->*ptr) (args) http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3448&database=gcc