hpp2plantuml icon indicating copy to clipboard operation
hpp2plantuml copied to clipboard

Problem parsing std::function member

Open mxmlnkn opened this issue 3 years ago • 2 comments

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.

mxmlnkn avatar Jul 06 '21 20:07 mxmlnkn

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.

thibaultmarin avatar Jul 10 '21 22:07 thibaultmarin

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

mxmlnkn avatar Jul 10 '21 22:07 mxmlnkn