@@ -2256,6 +2256,47 @@ TEST(FrontendTest, MoreCursedInheritance) {
2256
2256
2257
2257
// Note that this link skips `C` because it is devoid of `moo(int)`.
2258
2258
EXPECT_HAS_VIRTUAL_LINK (index, " B::moo(int)" , " D::moo(int)" );
2259
+
2260
+ // Qualified-name member accesses only create references to the base class
2261
+ // entities...
2262
+ EXPECT_HAS_REFERENCE (
2263
+ index, Entity::Kind::kFunction , " A::" , " foo" , " ()" , " snippet.cc" , 2 , 2 ,
2264
+ " snippet.cc" , 19 , 19 , /* is_incomplete=*/ false ,
2265
+ /* template_prototype_entity_id=*/ std::nullopt,
2266
+ /* implicitly_defined_for_entity_id=*/ std::nullopt,
2267
+ /* enum_value=*/ std::nullopt, /* inherited_from_entity_id=*/ std::nullopt,
2268
+ /* virtual_method_kind=*/ Entity::VirtualMethodKind::kNonPureVirtual );
2269
+ EXPECT_HAS_REFERENCE (
2270
+ index, Entity::Kind::kFunction , " B::" , " foo" , " ()" , " snippet.cc" , 7 , 7 ,
2271
+ " snippet.cc" , 19 , 19 , /* is_incomplete=*/ false ,
2272
+ /* template_prototype_entity_id=*/ std::nullopt,
2273
+ /* implicitly_defined_for_entity_id=*/ std::nullopt,
2274
+ /* enum_value=*/ std::nullopt, /* inherited_from_entity_id=*/ std::nullopt,
2275
+ /* virtual_method_kind=*/ Entity::VirtualMethodKind::kNonPureVirtual );
2276
+ // ...whereas an unqualified-name one also creates a reference to the
2277
+ // synthesized inherited entity in the child.
2278
+ EXPECT_HAS_REFERENCE (
2279
+ index, Entity::Kind::kFunction , " C::" , " bar" , " ()" , " snippet.cc" , 13 , 13 ,
2280
+ " snippet.cc" , 21 , 21 , /* is_incomplete=*/ false ,
2281
+ /* template_prototype_entity_id=*/ std::nullopt,
2282
+ /* implicitly_defined_for_entity_id=*/ std::nullopt,
2283
+ /* enum_value=*/ std::nullopt, /* inherited_from_entity_id=*/ std::nullopt,
2284
+ /* virtual_method_kind=*/ Entity::VirtualMethodKind::kNonPureVirtual );
2285
+ EXPECT_HAS_REFERENCE (
2286
+ index, Entity::Kind::kFunction , " D::" , " bar" , " ()" , " snippet.cc" , 13 , 13 ,
2287
+ " snippet.cc" , 21 , 21 , /* is_incomplete=*/ false ,
2288
+ /* template_prototype_entity_id=*/ std::nullopt,
2289
+ /* implicitly_defined_for_entity_id=*/ std::nullopt,
2290
+ /* enum_value=*/ std::nullopt, /* inherited_from_entity_id=*/
2291
+ RequiredEntityId (
2292
+ index, Entity::Kind::kFunction , " C::" , " bar" , " ()" , " snippet.cc" , 13 ,
2293
+ 13 , /* is_incomplete=*/ false ,
2294
+ /* template_prototype_entity_id=*/ std::nullopt,
2295
+ /* implicitly_defined_for_entity_id=*/ std::nullopt,
2296
+ /* enum_value=*/ std::nullopt,
2297
+ /* inherited_from_entity_id=*/ std::nullopt,
2298
+ /* virtual_method_kind=*/ Entity::VirtualMethodKind::kNonPureVirtual ),
2299
+ /* virtual_method_kind=*/ Entity::VirtualMethodKind::kNonPureVirtual );
2259
2300
}
2260
2301
2261
2302
TEST (FrontendTest, InheritanceThroughTemplateInstantiation) {
0 commit comments