[aspectc-user] problem with a simple template instance matching test

Olaf Spinczyk Olaf.Spinczyk at informatik.uni-erlangen.de
Wed Dec 1 17:05:24 CET 2004


Hi,

riccobene-zzzz0002 at mailblocks.com wrote:
> Hello,
> i am testing the template instance matching in version 0.9 of ac++.
> 
> The simple tracing aspect of the AC++ Quick Reference Guide instantiated 
> in this way
> 
> aspect TraceMain: public Trace
> {
>    pointcut functions() = call("% Value<int>::%(...)") && within("% 
> main(...)");
> };
> 
> has no effect. In this way:
> 
> aspect TraceMain: public Trace
> {
>    //pointcut functions() = execution("Value<int>");
> };
> 
> it cause ac++.exe crash for memory access violation.
> 
> I am using ac++ on Win32 platform with --vc and --skip-bodies-non-prj flags.
> 
> The main.cpp is the following:
> 
> #include <iostream>
> 
> template <class T>
> class Value
> {
> public:
>    Value(T value): value_(value) {}
>    ~Value() {}
> 
>    void dummy()
>    {
>    }
> private:
>    T value_;
> };
> 
> int main ()
> {
>    std::cout << "in main\n";
> 
>    Value<int> a(1);
> 
>    a.dummy();
> 
>    std::cout << "Press return to exit...";
>    std::cin.get();
>    return 0;
> }
> 
> Thanks,
> michelangelo riccobene

you probably did not compile with the --real-instances option. Note that 
template matching and this new parser mode are still experimental features.

Olaf



More information about the aspectc-user mailing list