Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Donn Seeley
Tue, 25 Jul 1989 00:29
Re: g++ bugs
Author: Donn Seeley
Date: Tue, 25 Jul 1989 00:29
Date: Tue, 25 Jul 1989 00:29
37 lines
1808 bytes
1808 bytes
typedef int (*PF)();
class foo_c { PF fp; public: void m(); };
void foo_c::m() { return fp(); }
G++ 1.35.0 produces the error message 'component `fp' is not a method'.
There appears to be a logic error in the function hack_identifier in
cplus-method.c, which persists in G++ 1.35.1 (which we aren't running
since we're waiting for 1.36.0). The special case of a data member
that is a pointer to a function or to a member function is incorrectly
recognized; here's the fix I made:
*** /tmp/,RCSt1009094 Mon Jul 24 18:17:24 1989
--- cplus-method.c Mon Jul 24 17:50:04 1989
***************
*** 2171,2178 ****
&& TREE_CODE (type) != FUNCTION_TYPE
&& TREE_CODE (type) != METHOD_TYPE
&& (TREE_CODE (type) != POINTER_TYPE
! || TREE_CODE (TREE_TYPE (type)) != FUNCTION_TYPE
! || TREE_CODE (TREE_TYPE (type)) != METHOD_TYPE))
{
error ("component `%s' is not a method",
IDENTIFIER_POINTER (name));
--- 2171,2178 ----
&& TREE_CODE (type) != FUNCTION_TYPE
&& TREE_CODE (type) != METHOD_TYPE
&& (TREE_CODE (type) != POINTER_TYPE
! || (TREE_CODE (TREE_TYPE (type)) != FUNCTION_TYPE
! && TREE_CODE (TREE_TYPE (type)) != METHOD_TYPE)))
{
error ("component `%s' is not a method",
IDENTIFIER_POINTER (name));
Donn Seeley University of Utah CS Dept donn@cs.utah.edu
40 46' 6"N 111 50' 34"W (801) 581-5668 utah-cs!donn
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads