From c4a47b38c51774d77d1c712e1359c196545e87f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Thu, 30 Jun 2022 14:58:49 +0200 Subject: [PATCH] Expand duplicate definition check --- src/cpp_entity_index.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cpp_entity_index.cpp b/src/cpp_entity_index.cpp index e802b9b..2393f64 100644 --- a/src/cpp_entity_index.cpp +++ b/src/cpp_entity_index.cpp @@ -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();