thibaultmarin / hpp2plantuml

Convert C++ header files to PlantUML
MIT License
223 stars 35 forks source link

Problem parsing std::function member #18

Open mxmlnkn opened 3 years ago

mxmlnkn commented 3 years ago

Given this input header:

#pragma once

#include <functional>
#include <memory>

class Foo
{
    std::function<std::shared_ptr<BlockFinder>(void)> const m_startBlockFinder;
    std::shared_ptr<BlockFinder> m_blockFinder;
};

and parsing it with:

hpp2plantuml -i hpp2uml-bracket-bug.hpp

I get (shortened for brevity):

@startuml
class Foo {
    ->() : std::function<std::shared_ptr<BlockFinder {query}
    -m_blockFinder : std::shared_ptr<BlockFinder>
}
@enduml

It looks like m_startBlockFinder got interpreted as a method with name > instead of being recognized as a member.

thibaultmarin commented 3 years ago

The robotpy-cppheaderparser package, which is used to parse the headers, indeed parses the member function as a method (with a wrong name). Maybe this could be reported upstream.

mxmlnkn commented 3 years ago

I see. Thanks for investigating. I think reporting it upstream would be the best choice.