[aspectc-user] error: ‘advice’ does not name a type

Panu Bloigu panu.bloigu at mbnet.fi
Fri May 18 16:26:38 CEST 2007


Hello.

I have a question about using undefined (abstract) pointcuts in a slice 
advice. It seems that if all abstract pointcuts *have* to be defined if 
they're used in a slice advice. To see what I mean, please consider the 
following code:

=============================================================================
File: notype.cpp
=============================================================================
aspect Base
{
        pointcut virtual target() = 0;

        advice target() : slice class
        {

        };
};

int main()
{
        return 0;
}
=============================================================================

When I issue the command:
=============================================================================
ag++ -k --keep_acc notype.cpp -o notype
=============================================================================

the backend g++ woes:
=============================================================================
notype.cpp:5: error: ‘advice’ does not name a type
error: Execution failed: "g++" -xc++ "notype.acc" -xnone -I"." -o "notype"
=============================================================================

It seems that when ac++ generates a class from the aspect Base, it 
leaves the slice advice untouched if the target of the introduction 
isn't defined (but is introduced as a virtual pointcut).

Of course g++ isn't happy at all with advices.

My question is that is this behavior intended, i.e. does the 
introduction target always have to defined?

Panu.




More information about the aspectc-user mailing list