This is the mail archive of the gcc-bugs@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]

c++/9418: g++ 3.2.1 does not recognise member function with ellipse (...)


>Number:         9418
>Category:       c++
>Synopsis:       g++ 3.2.1 does not recognise member function with ellipse (...)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 23 10:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Thomas.Willhalm@uni-konstanz.de
>Release:        gcc 3.2.1
>Organization:
>Environment:
Gentoo Linux 1.4RC2, mobile Pentium III, kernel 2.4.19
>Description:
Hello,

thank you for your efforts to support free software. As you might guess,
I think I have found a bug in g++ 3.2.1. The compilation of the following 
(to the best od my knowledge correct) code exits with an error.
(icc and the online comeau compiler accept it.)

+++++++++++++ begin code +++++++++++++++++

struct foo {
  static int bar(...);
  static int const RET = sizeof(bar(0));
};

int main() 
{ return 0; }

+++++++++++++  end code  +++++++++++++++++

When the code is compiled without any command line flags, I get the
following error message:
g++bug.cpp:5: invalid use of undefined type `struct foo'
g++bug.cpp:3: forward declaration of `struct foo'

The error disappears, if bar is not a member of foo. Calling bar(0) works
fine, too.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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