This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: c++/7737: g++ ver 3.2 Internal Compiler Error


The following reply was made to PR c++/7737; it has been noted by GNATS.

From: Reichelt <reichelt@igpm.rwth-aachen.de>
To: gcc-gnats@gcc.gnu.org, dwelter@sfwmd.gov, gcc-bugs@gcc.gnu.org,
        nobody@gcc.gnu.org
Cc:  
Subject: Re: c++/7737: g++ ver 3.2 Internal Compiler Error
Date: Wed, 28 Aug 2002 15:21:50 +0200

 Hi,
 
 the problem can be demonstrated with the following code snippet:
 
 -----------------------------snip here----------------------------
 struct A { void foo(); };
 void bar () { &(A::foo); }
 -----------------------------snip here----------------------------
 
 which is in fact illegal code. One should write "&A::foo" instead of
 "&(A::foo)". In the original code you have to replace "&(Wall::...Flow)"
 by "&Wall::...Flow" in the functions "Cell::OLVector()",
 "Cell::GWVector()" and "Cell::TotalVector()" to make things compile.
 
 The failures of gcc with the code snippet are quite interesting:
 * With gcc 2.95.x the code compiles using "g++ -c" (even with
   "-pedantic" turned on), which is wrong.
 * With gcc 3.0.x I get the error message
   PR7737.cc: In function `void bar()':
   PR7737.cc:2: warning: statement cannot resolve address of overloaded function
   which is bogus
 * With 3.1 and 3.2 I get an ICE:
   PR7737.cc: In function `void bar()':
   PR7737.cc:2: Internal compiler error in resolve_offset_ref, at cp/init.c:1886
 
 However with the main trunk (gcc 3.3 20020816) I get the right diagnostic:
   PR7737.cc: In function `void bar()':
   PR7737.cc:2: error: parenthesis around 'A::foo()' cannot be used to form a 
      pointer-to-member-function
 
 Greetings,
 Volker Reichelt
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7737
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]