Hi All,
I have just started working on a small patch for doxygen that attempts
to improve the matching of function parameters when used with templates.
In particular if I run doxygen over the following:
#include <set>
// Example in the global namespace.
class Blah1{};
void Function1(std::set<Blah1>&);
/** \fn Function1(std::set<Blah1, std::less<Blah1>,
std::allocator<Blah1> > &)
* \brief Some brief 1.
*
* A detail section 1.
*/
// Example inside a namespace called EDoc.
namespace EDoc
{
class Blah2{};
void Function2(std::set<Blah2>&);
}
/** \fn EDoc::Function2(std::set<EDoc::Blah2, std::less<EDoc::Blah2>,
std::allocator<EDoc::Blah2> > &)
* \brief Some brief 2.
*
* A detail section 2.
*/
It should successfully match the documentation provided by the \fn
blocks with the function declarations. These two identifiers are
actually identical, its just that one explicitly states the default
template parameters.
I need this functionality as i have a program that generates \fn
blocks that explicitly state the entire template. I have not yet found
a way of getting it to omit default template parameters. So i hope to
improve doxygen a little by allowing it to match such blocks. So far
with the exception of the bug mentioned below i think it have a
successful modification.
I have come across what seems like a bug in doxygen that is stopping
my patch from working in all situations.
In particular if you process the above with Doxygen 1.5.1 you will get
the following warnings:
/home/bcosta/dev/test/doxy.cpp:6: Warning: no matching file member
found for
Function1(std::set< Blah1, std::less< Blah1 >, std::allocator< Blah1 >
> &)
Possible candidates:
void Function1(std::set< Blah1 > &)
/home/bcosta/dev/test/doxy.cpp:18: Warning: no matching file member
found for
EDoc::Function2(std::set< EDoc::Blah2, std::less< EDoc::EDoc::Blah2 >,
std::allocator< EDoc::Blah2 > > &)
Possible candidates:
void Function2(std::set< Blah2 > &)
The first warning is as expected (And is not generated when using the
patch) but the second one shows the bug. Notice the
std::less<EDoc::EDoc::Blah2> Doxygen is for some reason incorrectly
giving the prefix of Bah2 as EDoc::EDoc:: not EDoc::
Would it be possible for someone to look into this? I am not at all
familiar with Doxygens parsing and have no idea where this additional
EDoc:: layer could be coming from. Eithre that or if someone would be
willing to point me to the place in code where I can look further into
this problem i would greatly appreciate it.
Thanks,
Brendon.
|