This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
gcc 3.1PR implicit typename depricated warnings and errors
- From: Gianni Mariani <gianni at mariani dot ws>
- To: gcc <gcc at gcc dot gnu dot org>
- Date: Mon, 13 May 2002 09:32:26 -0700
- Subject: gcc 3.1PR implicit typename depricated warnings and errors
gcc3.1 PR - if I follow the suggestions from the compiler and place a
'typename' in the given place ( see where theTYPENAME_SYNTAX_ERROR macro
expands) the gcc 3.1 compiler complains that it's a syntax error to do
so. The code below is demonstrates this - uncomment the 'typename'
keyword from the macro to demonstrate the compiler's syntax error report
or leave it commented and experience a warning.
Any suggestions on working around this one - I like leaving the warnings
enabled but I'd also like to leave the code compiling.
#============= snip =======================
#include <list>
template< class client_base, class service_base>
class TMPL_A;
template< class client_base, class service_base>
class TMPL_B;
template< class client_base, class service_base>
class TMPL_C {
public:
typedef TMPL_A< client_base,service_base> * t_elem_type;
typedef std::list< t_elem_type > t_x_list;
typedef typename t_x_list::iterator t_x_iter;
typedef typename std::list< t_x_iter > t_x_iter_list;
typedef typename t_x_iter_list::iterator t_x_iter_iter;
};
// ======== TMPL_A ===============================
/**
* TMPL_A is a template for Service handler for
* a client.
*
*/
template< class client_base, class service_base>
class TMPL_A
: public client_base,
public TMPL_C<client_base,service_base>
{
public:
#define TYPENAME_SYNTAX_ERROR //typename
// define some members
TYPENAME_SYNTAX_ERROR t_x_iter m_my_iter;
TMPL_B<client_base,service_base> * m_my_service;
// some more stuff goes here
};