Expand duplicate definition check

This commit is contained in:
Jonathan Müller 2022-06-30 14:58:49 +02:00
commit c4a47b38c5

View file

@ -25,7 +25,8 @@ void cpp_entity_index::register_definition(cpp_entity_id
{
// already in map, override declaration
auto& value = result.first->second;
if (value.is_definition && !is_template(value.entity->kind()))
if (value.is_definition && !is_template(value.entity->kind()) && entity->parent()
&& !is_template(entity->parent().value().kind()))
// allow duplicate definition of templates
// this handles things such as SFINAE
throw duplicate_definition_error();