c++/9257: Unuseful warning about all member functions being private

bangerth@ticam.utexas.edu bangerth@ticam.utexas.edu
Mon Jan 13 05:17:00 GMT 2003


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



More information about the Gcc-bugs mailing list