Fix constructor prefix skipping
This commit is contained in:
parent
7a9f6fdfac
commit
232842f2f6
1 changed files with 27 additions and 23 deletions
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
#include <cppast/cpp_function.hpp>
|
#include <cppast/cpp_function.hpp>
|
||||||
#include <cppast/cpp_member_function.hpp>
|
#include <cppast/cpp_member_function.hpp>
|
||||||
#include <clang-c/Index.h>
|
|
||||||
|
|
||||||
#include "libclang_visitor.hpp"
|
#include "libclang_visitor.hpp"
|
||||||
#include "parse_functions.hpp"
|
#include "parse_functions.hpp"
|
||||||
|
|
@ -159,11 +158,13 @@ namespace
|
||||||
// name can have multiple tokens if it is an operator
|
// name can have multiple tokens if it is an operator
|
||||||
if (!detail::skip_if(stream, name, true))
|
if (!detail::skip_if(stream, name, true))
|
||||||
return false;
|
return false;
|
||||||
else if (!is_ctor)
|
else if (stream.peek() == "," || stream.peek() == ">" || stream.peek() == ">>")
|
||||||
return true;
|
// argument to template parameters
|
||||||
// if we reach this point, we've encountered the name of a constructor
|
return false;
|
||||||
|
else if (is_ctor)
|
||||||
|
{
|
||||||
// need to make sure it is not actually a class name
|
// need to make sure it is not actually a class name
|
||||||
else if (stream.peek() == "::")
|
if (stream.peek() == "::")
|
||||||
{
|
{
|
||||||
// after name came "::", it is a class name
|
// after name came "::", it is a class name
|
||||||
stream.set_cur(cur);
|
stream.set_cur(cur);
|
||||||
|
|
@ -191,6 +192,9 @@ namespace
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
prefix_info parse_prefix_info(detail::token_stream& stream, const char* name, bool is_ctor)
|
prefix_info parse_prefix_info(detail::token_stream& stream, const char* name, bool is_ctor)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue