[aspectc-user] template instantiation regression

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Mon Mar 8 15:01:19 CET 2010


Hi Michael,

this seems to be a bug. If you remove 'typename' from the line

typedef typename select< sizeof(int)==BYTES, int, ERROR_inttype_not_available>::T T;

it works as expected. However, using 'typename' at this point is correct. We'll 
look into this problem.

Cheers,

Olaf

Michael Stilkerich wrote:
> Hi again,
>
>   in the course of updating AC++ to a current revision I discovered a regression related to template instantiation. Consider the following example (I tried to strip down the example as much as possible while still producing the problem):
>
> ------------------  test.cpp  ------------------
> class ERROR_inttype_not_available {
> };
>
> template< bool FIRST, class A, class B > struct select  {
>   typedef A T;
> };
>
> template< class A, class B > struct select< false, A, B > {
>   typedef B T;
> };
>
> template< unsigned BYTES > struct int_t {
>   typedef typename select< sizeof(int)==BYTES, int, ERROR_inttype_not_available>::T T;
> };
>
>
> void testfunc(int_t<4>::T i);
>
> void test() {
>   testfunc(3);
> }
>
> ------------------  test.ah  ------------------
> aspect Test {
>         advice call("% testfunc(...)"): around() {
>         }
> };
>
> While the above pointcut expression matches the call testfunc(3) with the old AC++ version (ac++ 1.0pre4 (Jun 21 2007)), it does not match with recent builds anymore. 
>
> Regards,
>  -Michael
> ------------------------------------------------------------------------
>
> _______________________________________________
> aspectc-user mailing list
> aspectc-user at aspectc.org
> http://www.aspectc.org/mailman/listinfo/aspectc-user
>   





More information about the aspectc-user mailing list