[aspectc-user] const functions

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Wed May 28 10:11:10 CEST 2003


Hi,

Olaf Spinczyk wrote:
> Hi Sven,
> 
> Sven.Apel at metop-md.de wrote:
> 
>> Hallo,
>>
>> I get an error when I try to refer (inside a pointcut) to a constant
>> function:
>>
>> class Attribute
>> {
>>     ...
>>     Value Get() const {return m_value;}
>> };
>>
>> aspect TupleLockAspect
>> {
>>     pointcut locking() =    execution("% Attribute::Get(...)");
>> };
>>
>> the error message:
>>
>> ./ac_gen.cc(238): error C2440: 'Initialisierung' : 'const Attribute
>> *const ' kann nicht in 'void *' konvertiert werden
>>
>> What is the problem?
>>
>> best regards
>> Sven
> 
> 
> this looks like Bug 76 in our Bugzilla system. In the generated code the 
> 'this' pointer is assigned to a 'void*' variable. This is not allowed by 
> the back-end C++ compiler if the object, which is referenced by 'this', 
> is constant. That only happens if your advice code accesses 
> 'thisJoinPoint'.
> 
> The bug isn't fixed yet. Meanwhile you can only try to avoid using 
> thisJoinPoint in that particular advice or make the function 
> non-constant :-(.
> 
> Yours,
> 
> Olaf

The bug is fixed now. The fix will be included in version 0.7.

Olaf





More information about the aspectc-user mailing list