standardese/cppast

Using declaration not resolving

deadlocklogic opened this issue · 1 comments

Consider this:

    cppast::cpp_entity_index _idx;
    cppast::libclang_parser _parser;
    cppast::libclang_compile_config _config;
    auto _file = parse(_idx, "test", R"(
namespace cppast
{
class cpp_template
{
    protected:
    template <class T, class EntityT>
    class basic_builder
    {
    public:
        basic_builder() {}

        basic_builder(basic_builder&&) = default;
    };
};

/// A [cppast::cpp_entity]() modelling a function template.
class cpp_function_template final : public cpp_template
{
public:
    class builder : public basic_builder<void, void>
    {
    public:
        using basic_builder::basic_builder;
    };
};
}
)", true);
    cppast::visit(*_file, [&](const cppast::cpp_entity& e, cppast::visitor_info info) {
        if (info.event != cppast::visitor_info::container_entity_exit) {
            if (e.kind() == cppast::cpp_entity_kind::using_declaration_t) {
                auto& target = dynamic_cast<const cppast::cpp_using_declaration&>(e).target();
                if (target.no_overloaded().get() > 0) {
                    auto refs = target.get(_idx);
                    if (refs.size() > 0) {
                        auto ref = refs[0];
                    }
                }
            }
        }
        return true;
    });

Using declaration using basic_builder::basic_builder; is failing to resolve.
Possible bug, or limitation?

This is the same underlying problem as #127: you're referring to basic_builder<void, void>, cppast only knows about basic_builder<T, EntityT> and has no knowledge of connecting the two. I'm closing this as a duplicate.