[Bug c++/33336] New: Using predefined macros inside the template function errors out in compilation
#include #define MEM_COPY(from,to,size) memcpy((to),(from),(size)) #define MEMCOPY(from,to,n_items,type) \ MEM_COPY((char *)(from),(char *)(to),(unsigned)(n_items)*sizeof(type)) template class RPGVec { public: virtual int Copy( RPGVec &Vin); } template int RPGVec::Copy( RPGVec &Vin) { MEMCOPY( Vin.Adr(), this->Adr(), 10, T); return SUCCES; } error: there are no arguments to `MEM_COPY' that depend on a template parameter, so a declaration of `MEM_COPY' must be available How do I fix this ? Thank you -- Summary: Using predefined macros inside the template function errors out in compilation Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: raviprakashg at hotmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6
[Bug c++/33336] Using predefined macros inside the template function errors out in compilation
--- Comment #2 from raviprakashg at hotmail dot com 2007-09-07 18:40 --- Thank you, The problem was found to be MEM_COPY was in a different #ifdef loop in my application that caused the error. Thank you for your input. -- raviprakashg at hotmail dot com changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6
[Bug c++/32740] New: parser error when passing the template arg to STL
//File template_test.cpp # include # include class V { public: template static void RPG(const std::vector& listIn, std::vector& listOut); } ; template inline void V::RPG(const std::vector& listIn, std::vector& listOut) { for(std::vector::const_iterator iter = listIn.begin(); iter != listIn.end(); iter++) { //do nothing } } When compiling this the parser errors out with the below message *** g++ -c template_test.cpp template_test.cpp: In static member function `static void V::RPG(const std::vector >&, std::vector >&)': template_test.cpp:17: error: expected `;' before "iter" template_test.cpp:17: error: `iter' undeclared (first use this function) template_test.cpp:17: error: (Each undeclared identifier is reported only once for each function it appears in.) * Any help here ? Thank you, Ravi -- Summary: parser error when passing the template arg to STL Product: gcc Version: 3.4.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: raviprakashg at hotmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32740
[Bug c++/32740] parser error when passing the template arg to STL
--- Comment #2 from raviprakashg at hotmail dot com 2007-07-12 15:59 --- Thank you. -- raviprakashg at hotmail dot com changed: What|Removed |Added Status|RESOLVED|VERIFIED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32740