This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with member function template, template type and 'template' keyword
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: Edward Diener <eldlistmailingz at tropicsoft dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Tue, 15 Mar 2011 23:03:26 +0000
- Subject: Re: Problem with member function template, template type and 'template' keyword
- References: <iloiuj$ms1$1@dough.gmane.org>
On 15 March 2011 20:41, Edward Diener wrote:
> Attempting to compiling the following code using gcc 4.5.2 with the
> -std=c++0x option so I can use static_assert erroneously triggers a
> static_assert "failure in TTest2". Is this a known bug ?
I don't think so, please report it to bugzilla.
It can be reduced to:
struct AType
{
template<class AA>
void SomeFuncTemplate()
{ }
};
template < class T >
struct TTest2
{
template<T> struct helper;
template<class U>
static void check(helper<&U::template SomeFuncTemplate<int> > *);
};
int main()
{
TTest2< void (AType::*)() >::check<AType>(0);
}
This should compile, but doesn't with any version of G++ since at least 4.4