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]

Access control + static ctor = bad error message


According to Jason Merrill:
> Fixed.

Thanks!  Looks like it works just fine now.

But I have a related nit to report: When I break visibility rules in a
static initializer, the resulting error message reveals a lot more of
g++'s internals that we probably would like.  Given this priv.cc:

  class B { B(int) {} }; // intentionally private
  B b(1);

Here are the messages:

  priv.cc: In function `void __static_initialization_and_destruction_0
  priv.cc: (int, int)':
  priv.cc:1: `B::B (int)' is private
  priv.cc:2: within this context

I should think that "In function `void __static_init...'" should be
prettyprinted as "In static initialization".  If that's OK, I'll make
a patch.
-- 
Chip Salzenberg              - a.k.a. -              <chip@valinux.com>
"I wanted to play hopscotch with the impenetrable mystery of existence,
    but he stepped in a wormhole and had to go in early."  // MST3K

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