Fix USR collision with SFINAE in return type
This commit is contained in:
parent
b6767ffdeb
commit
f1fc25387e
1 changed files with 10 additions and 1 deletions
|
|
@ -15,7 +15,16 @@ cpp_entity_id detail::get_entity_id(const CXCursor& cur)
|
|||
{
|
||||
cxstring usr(clang_getCursorUSR(cur));
|
||||
DEBUG_ASSERT(!usr.empty(), detail::parse_error_handler{}, cur, "cannot create id for entity");
|
||||
return cpp_entity_id(usr.c_str());
|
||||
if (clang_getCursorKind(cur) == CXCursor_FunctionTemplate)
|
||||
{
|
||||
// we have a function template
|
||||
// combine return type with USR to ensure no ambiguity when SFINAE is applied there
|
||||
// (and hope this prevents all collisions...)
|
||||
cxstring type_spelling(clang_getTypeSpelling(clang_getCursorResultType(cur)));
|
||||
return cpp_entity_id(std::string(usr.c_str()) + type_spelling.c_str());
|
||||
}
|
||||
else
|
||||
return cpp_entity_id(usr.c_str());
|
||||
}
|
||||
|
||||
detail::cxstring detail::get_cursor_name(const CXCursor& cur)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue