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++/9259: Error on initialization of static member variable with sizeof(function_call())


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


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