[aspectc-user] calls to template members not matched
Panu Bloigu
panu.bloigu at mbnet.fi
Sun Jan 7 13:19:50 CET 2007
Hello.
> It might also help you to know that there are two ac++ test programs
> that use the STL in the real-instances mode: one uses <string>, the
>
...
> Does that work for you?
I don't seem to be able to get even the test code to compile with
--real-instances. What I have been trying to do is to go to the
directory /AspectC++/tests/STLSet under the AspectC++ sources and issue
the command
ag++ --c_compiler g++ --keep_acc --real-instances -k -p ./ -c main.cc
--Xcompiler -o main.o -D_useAC -O0 -g3 -Wall -fmessage-length=0
The compiler gives me the following errors:
main.cc:12: In instantiation of `set<int>':
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_set.h:130:
In instantiation of `_Rb_tree<int,int,std::_Identity< int >,std::less<
int >,std::allocator< int >>':
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_tree.h:414:
error: invalid member declaration near token `}'
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_tree.h:435:
error: invalid member declaration near token `}'
/usr/lib/gcc/i386-redhat-linux/4.1.1/../../../../include/c++/4.1.1/bits/stl_tree.h:397:
error: expected a constant as argument 2
error: Execution failed: "ac++" --config "puma.config" --real-instances
-k -p"./" -D"_useAC" -c "main.cc" -o "main.acc"
Without --real-instances the compilation goes just fine, but the call to
set<int>::insert(int) isn't matched. Also, the pointcut definition used
to match the call seems odd to me:
call ("% ...::%(...)" && !"% printf(...)")
I have understood that to match a call to a template function the match
expression should contain "<...>" or something similar somewhere in the
expression.
And then now follows a real mystery. The test code under
/AspectC++/tests/STLString compiles prefectly with --real-instances AND
the pointcut
call ("% foo(... :: basic_string<char,...>)" && !"% printf(...)")
is matched!
I'm very confused. Could you please tell me what is going on here? I'm
using gcc 4.1.1 on Fedora Core 6 with ac++ 1.0pre3.
Thanks,
Panu.
More information about the aspectc-user
mailing list