c++/10854: "XXX is private within this context" when trying to specialize private member template

derrick@cco.caltech.edu derrick@cco.caltech.edu
Mon May 19 10:08:00 GMT 2003


>Number:         10854
>Category:       c++
>Synopsis:       "XXX is private within this context" when trying to specialize private member template
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Mon May 19 09:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Derrick Bass
>Release:        gcc-3.3
>Organization:
>Environment:

>Description:
When this code is compiled:
class X {
private:
  template<bool T>
  struct Y;
};

template<>
struct X::Y<false> {
};

gcc 3.3 gives the following error:
privatetest.cc:4: error: `template<bool T> struct X::Y' is private
privatetest.cc:8: error: within this context

Previous versions of gcc accept the code (well, 3.1 and 3.2.2 definitely).
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list