Bug 13461 - Fails to access protected-ctor from public constant
Summary: Fails to access protected-ctor from public constant
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.2
: P1 normal
Target Milestone: 3.3.3
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-22 10:30 UTC by Die uwe Ysbeer
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host: Linux Mandrake kernel 2.4.21 i686
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Die uwe Ysbeer 2003-12-22 10:30:17 UTC
The following code compiles in all versions of g++ 3.2 and earlier that I 
tested. AFAIK this is legal C++ (unless I have missed some ru
Comment 1 Die uwe Ysbeer 2003-12-22 11:47:52 UTC
SOrry wrong example. The following one causes the prblem: 
 
template <typename T,typename Y> 
class C 
{ 
public: 
	typedef C<T,Y> self; 
	static const self value; 
protected: 
	C() {} 
}; 
 
template <typename T,typename Y> 
C<T,Y> const C<T,Y>::value; 
 
 
int main() 
{ 
	C<int,int> const& x= C<int,int>::value; 
} 
 
Comment 2 Kriang Lerdsuwanakij 2003-12-22 13:51:31 UTC
This has just been fixed in the CVS and the fix will appear in future GCC 3.3.3
and GCC 3.4.