diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-08-23 22:49:33 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-08-23 22:49:33 +0900 |
commit | bf5ca79e85ab036169c4aa3a1fed569fe7e63909 (patch) | |
tree | c7323c123eb2f04c1592a5692579c678620820ac /lib/cppparser | |
parent | f41a2c189e3477fb47791a07b0a6f4948afa8272 (diff) | |
download | tdevelop-bf5ca79e85ab036169c4aa3a1fed569fe7e63909.tar.gz tdevelop-bf5ca79e85ab036169c4aa3a1fed569fe7e63909.zip |
Fixed typedef-related warnings from compiler.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'lib/cppparser')
-rw-r--r-- | lib/cppparser/ast.h | 192 |
1 files changed, 53 insertions, 139 deletions
diff --git a/lib/cppparser/ast.h b/lib/cppparser/ast.h index 4c71855a..a55325bd 100644 --- a/lib/cppparser/ast.h +++ b/lib/cppparser/ast.h @@ -26,92 +26,6 @@ #include <tqstringlist.h> #include <ksharedptr.h> -#if defined( Q_OS_WIN32 ) || defined( TQ_CC_SUN ) - -#ifndef _THROW0 -# define _THROW0() -#endif - -template <class _Tp> class AUTO_PTR { -private: - _Tp* _M_ptr; - -public: - typedef _Tp element_type; - - explicit AUTO_PTR(_Tp* __p = 0) _THROW0() : _M_ptr(__p) {} - - template <class _Tp1> AUTO_PTR(AUTO_PTR<_Tp1>& __a) _THROW0() - : _M_ptr(__a.release()) {} - - AUTO_PTR(AUTO_PTR& __a) _THROW0() : _M_ptr(__a.release()) {} - - - - template <class _Tp1> - AUTO_PTR& operator=(AUTO_PTR<_Tp1>& __a) _THROW0() { - if (__a.get() != this->get()) { - delete _M_ptr; - _M_ptr = __a.release(); - } - return *this; - } - - AUTO_PTR& operator=(AUTO_PTR& __a) _THROW0() { - if (&__a != this) { - delete _M_ptr; - _M_ptr = __a.release(); - } - return *this; - } - - ~AUTO_PTR() _THROW0() { delete _M_ptr; } - - _Tp& operator*() const _THROW0() { - return *_M_ptr; - } - _Tp* operator->() const _THROW0() { - return _M_ptr; - } - _Tp* get() const _THROW0() { - return _M_ptr; - } - _Tp* release() _THROW0() { - _Tp* __tmp = _M_ptr; - _M_ptr = 0; - return __tmp; - } - void reset(_Tp* __p = 0) _THROW0() { - delete _M_ptr; - _M_ptr = __p; - } - - // According to the C++ standard, these conversions are required. Most - // present-day compilers, however, do not enforce that requirement---and, - // in fact, most present-day compilers do not support the language - // features that these conversions rely on. - - -private: - template<class _Tp1> struct AUTO_PTR_ref { - _Tp1* _M_ptr; - AUTO_PTR_ref(_Tp1* __p) : _M_ptr(__p) {} - }; - -public: - AUTO_PTR(AUTO_PTR_ref<_Tp> __ref) _THROW0() - : _M_ptr(__ref._M_ptr) {} - template <class _Tp1> operator AUTO_PTR_ref<_Tp1>() _THROW0() - { return AUTO_PTR_ref<_Tp>(this->release()); } - template <class _Tp1> operator AUTO_PTR<_Tp1>() _THROW0() - { return AUTO_PTR<_Tp1>(this->release()) } - -}; - -#else -#define AUTO_PTR std::auto_ptr -#endif - template <class T> typename T::Node CreateNode() { typename T::Node node( new T ); @@ -241,7 +155,7 @@ class CommentAST { class AST : public CommentAST { public: - typedef AUTO_PTR<AST> Node; + typedef std::auto_ptr<AST> Node; enum { Type=NodeType_Generic }; DECLARE_ALLOC( AST ) @@ -303,7 +217,7 @@ private: class GroupAST: public AST { public: - typedef AUTO_PTR<GroupAST> Node; + typedef std::auto_ptr<GroupAST> Node; enum { Type = NodeType_Group }; DECLARE_ALLOC( GroupAST ) @@ -328,7 +242,7 @@ private: class TemplateArgumentListAST: public AST { public: - typedef AUTO_PTR<TemplateArgumentListAST> Node; + typedef std::auto_ptr<TemplateArgumentListAST> Node; enum { Type = NodeType_TemplateArgumentList }; DECLARE_ALLOC( TemplateArgumentListAST ) @@ -352,7 +266,7 @@ private: class ClassOrNamespaceNameAST: public AST { public: - typedef AUTO_PTR<ClassOrNamespaceNameAST> Node; + typedef std::auto_ptr<ClassOrNamespaceNameAST> Node; enum { Type = NodeType_ClassOrNamespaceName }; DECLARE_ALLOC( ClassOrNamespaceNameAST ) @@ -380,7 +294,7 @@ private: class NameAST: public AST { public: - typedef AUTO_PTR<NameAST> Node; + typedef std::auto_ptr<NameAST> Node; enum { Type = NodeType_Name }; DECLARE_ALLOC( NameAST ) @@ -412,7 +326,7 @@ private: class TypeParameterAST: public AST { public: - typedef AUTO_PTR<TypeParameterAST> Node; + typedef std::auto_ptr<TypeParameterAST> Node; enum { Type = NodeType_TypeParameter }; DECLARE_ALLOC( TypeParameterAST ) @@ -424,7 +338,7 @@ public: void setKind( AST::Node& kind ); class TemplateParameterListAST* templateParameterList() { return m_templateParameterList.get(); } - void setTemplateParameterList( AUTO_PTR<class TemplateParameterListAST>& templateParameterList ); + void setTemplateParameterList( std::auto_ptr<class TemplateParameterListAST>& templateParameterList ); NameAST* name() { return m_name.get(); } void setName( NameAST::Node& name ); @@ -434,7 +348,7 @@ public: private: AST::Node m_kind; - AUTO_PTR<class TemplateParameterListAST> m_templateParameterList; + std::auto_ptr<class TemplateParameterListAST> m_templateParameterList; NameAST::Node m_name; AST::Node m_typeId; @@ -446,7 +360,7 @@ private: class DeclarationAST: public AST { public: - typedef AUTO_PTR<DeclarationAST> Node; + typedef std::auto_ptr<DeclarationAST> Node; enum { Type = NodeType_Declaration }; DECLARE_ALLOC( DeclarationAST ) @@ -462,7 +376,7 @@ private: class AccessDeclarationAST: public DeclarationAST { public: - typedef AUTO_PTR<AccessDeclarationAST> Node; + typedef std::auto_ptr<AccessDeclarationAST> Node; enum { Type = NodeType_AccessDeclaration }; DECLARE_ALLOC( AccessDeclarationAST ) @@ -486,7 +400,7 @@ private: class TypeSpecifierAST: public AST { public: - typedef AUTO_PTR<TypeSpecifierAST> Node; + typedef std::auto_ptr<TypeSpecifierAST> Node; enum { Type = NodeType_TypeSpecifier }; DECLARE_ALLOC( TypeSpecifierAST ) @@ -518,7 +432,7 @@ private: class BaseSpecifierAST: public AST { public: - typedef AUTO_PTR<BaseSpecifierAST> Node; + typedef std::auto_ptr<BaseSpecifierAST> Node; enum { Type = NodeType_BaseSpecifier }; DECLARE_ALLOC( BaseSpecifierAST ) @@ -548,7 +462,7 @@ private: class BaseClauseAST: public AST { public: - typedef AUTO_PTR<BaseClauseAST> Node; + typedef std::auto_ptr<BaseClauseAST> Node; enum { Type = NodeType_BaseClause }; DECLARE_ALLOC( BaseClauseAST ) @@ -570,7 +484,7 @@ private: class ClassSpecifierAST: public TypeSpecifierAST { public: - typedef AUTO_PTR<ClassSpecifierAST> Node; + typedef std::auto_ptr<ClassSpecifierAST> Node; enum { Type = NodeType_ClassSpecifier }; DECLARE_ALLOC( ClassSpecifierAST ) @@ -603,7 +517,7 @@ private: class EnumeratorAST: public AST { public: - typedef AUTO_PTR<EnumeratorAST> Node; + typedef std::auto_ptr<EnumeratorAST> Node; enum { Type = NodeType_Enumerator }; DECLARE_ALLOC( EnumeratorAST ) @@ -629,7 +543,7 @@ private: class EnumSpecifierAST: public TypeSpecifierAST { public: - typedef AUTO_PTR<EnumSpecifierAST> Node; + typedef std::auto_ptr<EnumSpecifierAST> Node; enum { Type = NodeType_EnumSpecifier }; DECLARE_ALLOC( EnumSpecifierAST ) @@ -651,7 +565,7 @@ private: class ElaboratedTypeSpecifierAST: public TypeSpecifierAST { public: - typedef AUTO_PTR<ElaboratedTypeSpecifierAST> Node; + typedef std::auto_ptr<ElaboratedTypeSpecifierAST> Node; enum { Type = NodeType_ElaboratedTypeSpecifier }; DECLARE_ALLOC( ElaboratedTypeSpecifierAST ) @@ -676,7 +590,7 @@ private: class LinkageBodyAST: public AST { public: - typedef AUTO_PTR<LinkageBodyAST> Node; + typedef std::auto_ptr<LinkageBodyAST> Node; enum { Type = NodeType_LinkageBody }; DECLARE_ALLOC( LinkageBodyAST ) @@ -698,7 +612,7 @@ private: class LinkageSpecificationAST: public DeclarationAST { public: - typedef AUTO_PTR<LinkageSpecificationAST> Node; + typedef std::auto_ptr<LinkageSpecificationAST> Node; enum { Type = NodeType_LinkageSpecification }; DECLARE_ALLOC( LinkageSpecificationAST ) @@ -728,7 +642,7 @@ private: class NamespaceAST: public DeclarationAST { public: - typedef AUTO_PTR<NamespaceAST> Node; + typedef std::auto_ptr<NamespaceAST> Node; enum { Type = NodeType_Namespace }; DECLARE_ALLOC( NamespaceAST ) @@ -754,7 +668,7 @@ private: class NamespaceAliasAST: public DeclarationAST { public: - typedef AUTO_PTR<NamespaceAliasAST> Node; + typedef std::auto_ptr<NamespaceAliasAST> Node; enum { Type = NodeType_NamespaceAlias }; DECLARE_ALLOC( NamespaceAliasAST ) @@ -780,7 +694,7 @@ private: class UsingAST: public DeclarationAST { public: - typedef AUTO_PTR<UsingAST> Node; + typedef std::auto_ptr<UsingAST> Node; enum { Type = NodeType_Using }; DECLARE_ALLOC( UsingAST ) @@ -806,7 +720,7 @@ private: class UsingDirectiveAST: public DeclarationAST { public: - typedef AUTO_PTR<UsingDirectiveAST> Node; + typedef std::auto_ptr<UsingDirectiveAST> Node; enum { Type = NodeType_UsingDirective }; DECLARE_ALLOC( UsingDirectiveAST ) @@ -828,7 +742,7 @@ private: class DeclaratorAST: public AST { public: - typedef AUTO_PTR<DeclaratorAST> Node; + typedef std::auto_ptr<DeclaratorAST> Node; enum { Type = NodeType_Declarator }; DECLARE_ALLOC( DeclaratorAST ) @@ -840,7 +754,7 @@ public: void addPtrOp( AST::Node& ptrOp ); DeclaratorAST* subDeclarator() { return m_subDeclarator.get(); } - void setSubDeclarator( AUTO_PTR<DeclaratorAST>& subDeclarator ); + void setSubDeclarator( std::auto_ptr<DeclaratorAST>& subDeclarator ); NameAST* declaratorId() { return m_declaratorId.get(); } void setDeclaratorId( NameAST::Node& declaratorId ); @@ -852,7 +766,7 @@ public: void addArrayDimension( AST::Node& arrayDimension ); class ParameterDeclarationClauseAST* parameterDeclarationClause() { return m_parameterDeclarationClause.get(); } - void setParameterDeclarationClause( AUTO_PTR<class ParameterDeclarationClauseAST>& parameterDeclarationClause ); + void setParameterDeclarationClause( std::auto_ptr<class ParameterDeclarationClauseAST>& parameterDeclarationClause ); // ### replace 'constant' with cvQualify AST* constant() { return m_constant.get(); } @@ -863,11 +777,11 @@ public: private: TQPtrList<AST> m_ptrOpList; - AUTO_PTR<DeclaratorAST> m_subDeclarator; + std::auto_ptr<DeclaratorAST> m_subDeclarator; NameAST::Node m_declaratorId; AST::Node m_bitfieldInitialization; TQPtrList<AST> m_arrayDimensionList; - AUTO_PTR<class ParameterDeclarationClauseAST> m_parameterDeclarationClause; + std::auto_ptr<class ParameterDeclarationClauseAST> m_parameterDeclarationClause; AST::Node m_constant; GroupAST::Node m_exceptionSpecification; @@ -879,7 +793,7 @@ private: class ParameterDeclarationAST: public AST { public: - typedef AUTO_PTR<ParameterDeclarationAST> Node; + typedef std::auto_ptr<ParameterDeclarationAST> Node; enum { Type = NodeType_ParameterDeclaration }; DECLARE_ALLOC( ParameterDeclarationAST ) @@ -911,7 +825,7 @@ private: class ParameterDeclarationListAST: public AST { public: - typedef AUTO_PTR<ParameterDeclarationListAST> Node; + typedef std::auto_ptr<ParameterDeclarationListAST> Node; enum { Type = NodeType_ParameterDeclarationList }; DECLARE_ALLOC( ParameterDeclarationListAST ) @@ -935,7 +849,7 @@ private: class ParameterDeclarationClauseAST: public AST { public: - typedef AUTO_PTR<ParameterDeclarationClauseAST> Node; + typedef std::auto_ptr<ParameterDeclarationClauseAST> Node; enum { Type = NodeType_ParameterDeclarationClause }; DECLARE_ALLOC( ParameterDeclarationClauseAST ) @@ -964,7 +878,7 @@ private: class InitDeclaratorAST: public AST { public: - typedef AUTO_PTR<InitDeclaratorAST> Node; + typedef std::auto_ptr<InitDeclaratorAST> Node; enum { Type = NodeType_InitDeclarator }; DECLARE_ALLOC( InitDeclaratorAST ) @@ -990,7 +904,7 @@ private: class InitDeclaratorListAST: public AST { public: - typedef AUTO_PTR<InitDeclaratorListAST> Node; + typedef std::auto_ptr<InitDeclaratorListAST> Node; enum { Type = NodeType_InitDeclaratorList }; DECLARE_ALLOC( InitDeclaratorListAST ) @@ -1012,7 +926,7 @@ private: class TypedefAST: public DeclarationAST { public: - typedef AUTO_PTR<TypedefAST> Node; + typedef std::auto_ptr<TypedefAST> Node; enum { Type = NodeType_Typedef }; DECLARE_ALLOC( TypedefAST ) @@ -1038,7 +952,7 @@ private: class TemplateParameterAST: public AST { public: - typedef AUTO_PTR<TemplateParameterAST> Node; + typedef std::auto_ptr<TemplateParameterAST> Node; enum { Type = NodeType_TemplateParameter }; DECLARE_ALLOC( TemplateParameterAST ) @@ -1064,7 +978,7 @@ private: class TemplateParameterListAST: public AST { public: - typedef AUTO_PTR<TemplateParameterListAST> Node; + typedef std::auto_ptr<TemplateParameterListAST> Node; enum { Type = NodeType_TemplateParameterList }; DECLARE_ALLOC( TemplateParameterListAST ) @@ -1086,7 +1000,7 @@ private: class TemplateDeclarationAST: public DeclarationAST { public: - typedef AUTO_PTR<TemplateDeclarationAST> Node; + typedef std::auto_ptr<TemplateDeclarationAST> Node; enum { Type = NodeType_TemplateDeclaration }; DECLARE_ALLOC( TemplateDeclarationAST ) @@ -1116,7 +1030,7 @@ private: class SimpleDeclarationAST: public DeclarationAST { public: - typedef AUTO_PTR<SimpleDeclarationAST> Node; + typedef std::auto_ptr<SimpleDeclarationAST> Node; enum { Type = NodeType_SimpleDeclaration }; DECLARE_ALLOC( SimpleDeclarationAST ) @@ -1154,7 +1068,7 @@ private: class StatementAST: public AST { public: - typedef AUTO_PTR<StatementAST> Node; + typedef std::auto_ptr<StatementAST> Node; enum { Type = NodeType_Statement }; DECLARE_ALLOC( StatementAST ) @@ -1170,7 +1084,7 @@ private: class ExpressionStatementAST: public StatementAST { public: - typedef AUTO_PTR<ExpressionStatementAST> Node; + typedef std::auto_ptr<ExpressionStatementAST> Node; enum { Type = NodeType_ExpressionStatement }; DECLARE_ALLOC( ExpressionStatementAST ) @@ -1192,7 +1106,7 @@ private: class ConditionAST: public AST { public: - typedef AUTO_PTR<ConditionAST> Node; + typedef std::auto_ptr<ConditionAST> Node; enum { Type = NodeType_Condition }; DECLARE_ALLOC( ConditionAST ) @@ -1222,7 +1136,7 @@ private: class IfStatementAST: public StatementAST { public: - typedef AUTO_PTR<IfStatementAST> Node; + typedef std::auto_ptr<IfStatementAST> Node; enum { Type = NodeType_IfStatement }; DECLARE_ALLOC( IfStatementAST ) @@ -1252,7 +1166,7 @@ private: class WhileStatementAST: public StatementAST { public: - typedef AUTO_PTR<WhileStatementAST> Node; + typedef std::auto_ptr<WhileStatementAST> Node; enum { Type = NodeType_WhileStatement }; DECLARE_ALLOC( WhileStatementAST ) @@ -1278,7 +1192,7 @@ private: class DoStatementAST: public StatementAST { public: - typedef AUTO_PTR<DoStatementAST> Node; + typedef std::auto_ptr<DoStatementAST> Node; enum { Type = NodeType_DoStatement }; DECLARE_ALLOC( DoStatementAST ) @@ -1304,7 +1218,7 @@ private: class ForStatementAST: public StatementAST { public: - typedef AUTO_PTR<ForStatementAST> Node; + typedef std::auto_ptr<ForStatementAST> Node; enum { Type = NodeType_ForStatement }; DECLARE_ALLOC( ForStatementAST ) @@ -1339,7 +1253,7 @@ private: class ForEachStatementAST: public StatementAST { public: - typedef AUTO_PTR<ForEachStatementAST> Node; + typedef std::auto_ptr<ForEachStatementAST> Node; enum { Type = NodeType_ForEachStatement }; DECLARE_ALLOC( ForEachStatementAST ) @@ -1369,7 +1283,7 @@ private: class SwitchStatementAST: public StatementAST { public: - typedef AUTO_PTR<SwitchStatementAST> Node; + typedef std::auto_ptr<SwitchStatementAST> Node; enum { Type = NodeType_SwitchStatement }; DECLARE_ALLOC( SwitchStatementAST ) @@ -1395,7 +1309,7 @@ private: class StatementListAST: public StatementAST { public: - typedef AUTO_PTR<StatementListAST> Node; + typedef std::auto_ptr<StatementListAST> Node; enum { Type = NodeType_StatementList }; DECLARE_ALLOC( StatementListAST ) @@ -1417,7 +1331,7 @@ private: class CatchStatementAST: public StatementAST { public: - typedef AUTO_PTR<CatchStatementAST> Node; + typedef std::auto_ptr<CatchStatementAST> Node; enum { Type = NodeType_CatchStatement }; DECLARE_ALLOC( CatchStatementAST ) @@ -1443,7 +1357,7 @@ private: class CatchStatementListAST: public StatementAST { public: - typedef AUTO_PTR<CatchStatementListAST> Node; + typedef std::auto_ptr<CatchStatementListAST> Node; enum { Type = NodeType_CatchStatementList }; DECLARE_ALLOC( CatchStatementListAST ) @@ -1465,7 +1379,7 @@ private: class TryBlockStatementAST: public StatementAST { public: - typedef AUTO_PTR<TryBlockStatementAST> Node; + typedef std::auto_ptr<TryBlockStatementAST> Node; enum { Type = NodeType_TryBlockStatement }; DECLARE_ALLOC( TryBlockStatementAST ) @@ -1491,7 +1405,7 @@ private: class DeclarationStatementAST: public StatementAST { public: - typedef AUTO_PTR<DeclarationStatementAST> Node; + typedef std::auto_ptr<DeclarationStatementAST> Node; enum { Type = NodeType_DeclarationStatement }; DECLARE_ALLOC( DeclarationStatementAST ) @@ -1513,7 +1427,7 @@ private: class FunctionDefinitionAST: public DeclarationAST { public: - typedef AUTO_PTR<FunctionDefinitionAST> Node; + typedef std::auto_ptr<FunctionDefinitionAST> Node; enum { Type = NodeType_FunctionDefinition }; DECLARE_ALLOC( FunctionDefinitionAST ) |