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

Thomas.Willhalm@uni-konstanz.de Thomas.Willhalm@uni-konstanz.de
Thu Jan 23 10:26:00 GMT 2003


>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:



More information about the Gcc-prs mailing list