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

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Tue Jun 5 15:12:37 CEST 2007


Hi Panu,

this is filed under bug id 335. You are right, the weaver should removed
the advice before it is compiled by g++.

Thanks.

Olaf

Panu Bloigu wrote:
> 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.
> 
> _______________________________________________
> 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