Add cpp_variable_base

This commit is contained in:
Jonathan Müller 2017-01-22 12:53:49 +01:00
commit 4b69e823c8
4 changed files with 48 additions and 2 deletions

24
src/cpp_type_alias.cpp Normal file
View file

@ -0,0 +1,24 @@
// Copyright (C) 2017 Jonathan Müller <jonathanmueller.dev@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.
#include <cppast/cpp_type_alias.hpp>
#include <cppast/cpp_entity_kind.hpp>
using namespace cppast;
std::unique_ptr<cpp_type_alias> cpp_type_alias::build(const cpp_entity_index& idx, cpp_entity_id id,
std::string name,
std::unique_ptr<cpp_type> type)
{
auto result =
std::unique_ptr<cpp_type_alias>(new cpp_type_alias(std::move(name), std::move(type)));
idx.register_entity(std::move(id), type_safe::cref(*result));
return result;
}
cpp_entity_kind cpp_type_alias::do_get_entity_kind() const noexcept
{
return cpp_entity_kind::type_alias_t;
}

View file

@ -47,7 +47,7 @@ bool detail::visit(const cpp_entity& e, detail::visitor_callback_t cb, void* fun
case cpp_entity_kind::using_declaration_t:
case cpp_entity_kind::type_alias_t:
case cpp_entity_kind::enum_value_t:
return cb(functor, e, visitor_info::leave_entity);
return cb(functor, e, visitor_info::leaf_entity);
case cpp_entity_kind::count:
break;