This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9259: Error on initialization of static member variable with sizeof(function_call())
- From: bangerth at ticam dot utexas dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 10 Jan 2003 14:48:08 -0000
- Subject: c++/9259: Error on initialization of static member variable with sizeof(function_call())
- Reply-to: bangerth at ticam dot utexas dot edu
>Number: 9259
>Category: c++
>Synopsis: Error on initialization of static member variable with sizeof(function_call())
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Jan 10 06:56:03 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Wolfgang Bangerth
>Release: unknown-1.0
>Organization:
>Environment:
since at least 2.95 and up to present 3.4
>Description:
This surprisingly simple piece of code (modified from
BOOST) does not (and did never with any version of gcc)
compile:
------------------------------
struct S
{
static int check ();
static const int value = sizeof(check());
};
------------------------------
tmp/g> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c h.cc
h.cc:4: error: invalid use of undefined type `struct S'
h.cc:2: error: forward declaration of `struct S'
Volker (with help by Comeau's and SGI's compilers) and icc
also agree that this should compile.
W.
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: