This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/38579] [4.2/4.3/4.4 Regression] Template: Wrong inherited copy-ctor visibility
- From: "syntheticpp at gmx dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Jan 2009 18:29:13 -0000
- Subject: [Bug c++/38579] [4.2/4.3/4.4 Regression] Template: Wrong inherited copy-ctor visibility
- References: <bug-38579-13410@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from syntheticpp at gmx dot net 2009-01-14 18:29 -------
11.2 is talking about a different case.
When you instantiate the integer template parameter manually you will see that
it is really a bug:
struct Policy
{
protected:
Policy() {}
Policy(const Policy&) {}
};
template<class P>
struct BugGcc0 :
protected P
//public P
{
BugGcc0() {}
};
template<class P>
struct BugGcc1 : public P
{
BugGcc1() {}
template<class P1>
BugGcc1(const BugGcc0<P1>& t) : P(t) {}
};
void foo()
{
BugGcc0<Policy> d0;
BugGcc1<Policy> d1(d0);
}
The Policy ctor is visible within BugGcc1 (because it is inherited protected)
but it is not visible to a different class (again, because it is inherited
protected).
BugGcc0 and BugGcc1 only have the same base class but they are NOT of same type
which 11.2 talks about.
The protected policy ctor is only visible for BugGcc0 but not for BugGcc1.
--
syntheticpp at gmx dot net changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |syntheticpp at gmx dot net
Status|RESOLVED |REOPENED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38579