[aspectc-user] overload object 's constructor: bug or not?
郭 子
guo_zia at yahoo.com.cn
Sat Apr 10 04:09:12 CEST 2004
hi:
look at the following code:
in main.cc:
class Point{
int m_x,m_y;
public:
Point(int x,int y):m_x(x),m_y(y){}
Point Get(){ return *this; }
};
int main(void)
{
Point p(1,2);
Point p2(p.Get());
return(0);
}
in t1.ah:
#include <stdio.h>
aspect PointA{
pointcut calGet()=call("% %::Get(...)");
advice calGet() : after(){
printf("after Call Get()");
}
};
after ac++ manipulate
bcc32 -P main.cc
main.cc:
Error E2285 t1/main.cc 24: Could not find a match for 'Point::Point()' in function __call_main_0_0(Point *)
*** 1 errors in Compile ***
in manipulated main.cc there is code:
inline ::Point __call_main_0_0 (::Point *dstthis){
::Point result;
result = dstthis->Get();
AC::invoke_PointA_PointA_a0_after ();
return (::Point )result;
}
of course" ::Point result" is the problem,becouse no this constructor.
but in main.cc(not manipulated main.cc),I donot use this constructor.
so if we only compile this main.cc,there is no error.
bye the way ,i don't know why in bcc32:
Point p; is error
but
Point p();is correct.
yours truly,
guo_zia
---------------------------------
Do You Yahoo!?
惠普TT游戏剧,玩游戏,中大奖!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aspectc.org/pipermail/aspectc-user/attachments/20040410/4b78d483/attachment.html>
More information about the aspectc-user
mailing list