This is the mail archive of the
mailing list for the GCC project.
incorrect warning in 3.0.1 prerelease
- To: gcc at gcc dot gnu dot org
- Subject: incorrect warning in 3.0.1 prerelease
- From: Michael Price <mprice at atl dot lmco dot com>
- Date: Thu, 2 Aug 2001 16:50:53 -0400
- Cc: gcc-bugs at gcc dot gnu dot org
gcc version 3.0.1 (prerelease) give the following warning:
warning: `class Bar' only defines private constructors and has no friends
even when class Bar has public static methods. The result is that a proper
singleton gets the warning when it shouldn't.
The maybe_warn_about_overly_private_class(t) function in cp/class.c admits
/* A non-private static member function is just like a
friend; it can create and invoke private member
functions, and be accessed without a class
and even has a `if (DECL_STATIC_FUNCTION_P (fn))' but the warning is
Just letting you know.