This is the mail archive of the gcc@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]

incorrect warning in 3.0.1 prerelease


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

          /* 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
             instance.  */

and even has a `if (DECL_STATIC_FUNCTION_P (fn))' but the warning is
displayed anyway.

Just letting you know.

Michael


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