This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9257: Unuseful warning about all member functions being private
- From: bangerth at ticam dot utexas dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 10 Jan 2003 00:51:22 -0000
- Subject: c++/9257: Unuseful warning about all member functions being private
- Reply-to: bangerth at ticam dot utexas dot edu
>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: