c++/2564: Template Specialisations within Template Class no longer works

mgeddes@cybergraphic.com.au mgeddes@cybergraphic.com.au
Mon Apr 16 18:36:00 GMT 2001


>Number:         2564
>Category:       c++
>Synopsis:       Template Specialisations within Template Class no longer works
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 16 18:36:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Michael Geddes
>Release:        gcc 2.95.2
>Organization:
>Environment:

>Description:
This (albeit weird) template code compiled with 2.91? or so, but no longer compiles.  I am not sure how else this could be acheived.
------------8<---------------
template<typename T> struct conversion_aux
{
	template<typename U> class X
	{
	protected:
		class yes { };
		class no  {char a[10]; };
		static T makeT();
		
		static yes test(U);
		static no test(...);
	public:
		enum { exists = sizeof(test(makeT())) == sizeof(yes) };
		enum { same_type = false };
	};

	template<> class X<T>
	{
	public:
		enum { exists = true };
		enum { same_type = true };
	};
};
>How-To-Repeat:
Code supplied.
>Fix:

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



More information about the Gcc-bugs mailing list