This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem with member function template, template type and 'template' keyword


On 15 March 2011 23:03, Jonathan Wakely wrote:
> 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
>

N.B. -std=c++0x isn't needed for the reduced version as it doesn't use
static_assert


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]