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++/9257: Unuseful warning about all member functions being private


>Number:         9257
>Category:       c++
>Synopsis:       Unuseful warning about all member functions being private
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 09 16:56:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Wolfgang Bangerth
>Release:        unknown-1.0
>Organization:
>Environment:
All versions of gcc since at least 2.95, until 3.4
>Description:
This warning seems eminently unuseful:
---------------------------
struct C {
    static bool result;
  private:
    static bool check();    
};

bool C::result = check();
---------------------------

tmp/g> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -c y.cc
y.cc:1: warning: all member functions in class `C' are private

I know that I can switch this off with -w (can I do so
selectively?), but this does not make much sense anyway,
I think. The code comes modified from BOOST, and the
check function is used to infer properties of the
template argument of C (which I have or course stripped
away here).
>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]