Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Pass.hpp

    r90320ac raf746cc  
    222222        const ast::Type *             visit( const ast::UnionInstType        * ) override final;
    223223        const ast::Type *             visit( const ast::EnumInstType         * ) override final;
    224         const ast::Type *             visit( const ast::EnumPosType          * ) override final;
     224        const ast::Type *             visit( const ast::EnumAttrType         * ) override final;
    225225        const ast::Type *             visit( const ast::TraitInstType        * ) override final;
    226226        const ast::Type *             visit( const ast::TypeInstType         * ) override final;
     
    252252private:
    253253
    254         /// The return type of the general call_accept function.
     254        __pass::result1<ast::Stmt> call_accept( const ast::Stmt * );
     255        __pass::result1<ast::Expr> call_accept( const ast::Expr * );
     256
     257        /// This has a `type` member that is the return type for the
     258        /// generic call_accept if the generic call_accept is defined.
    255259        template< typename node_t >
    256         using call_accept_result_t = __pass::result1<
    257                 typename std::remove_pointer< typename std::result_of<
    258                         decltype(&node_t::accept)(node_t*, type&) >::type >::type
     260        using generic_call_accept_result =
     261                std::enable_if<
     262                                !std::is_base_of<ast::Expr, node_t>::value &&
     263                                !std::is_base_of<ast::Stmt, node_t>::value
     264                        , __pass::result1<
     265                                typename std::remove_pointer< typename std::result_of<
     266                                        decltype(&node_t::accept)(node_t*, type&) >::type >::type
     267                        >
    259268                >;
    260269
    261270        template< typename node_t >
    262         auto call_accept( const node_t * node ) -> call_accept_result_t<node_t>;
     271        auto call_accept( const node_t * node )
     272                -> typename generic_call_accept_result<node_t>::type;
    263273
    264274        // requests WithStmtsToAdd directly add to this statement, as if it is a compound.
Note: See TracChangeset for help on using the changeset viewer.