@@ -569,20 +569,6 @@ shouldExtract(
569
569
return true ;
570
570
}
571
571
572
- template <typename DeclTy>
573
- bool
574
- ASTVisitor::
575
- isImplicitInstantiation (
576
- const DeclTy* D)
577
- {
578
- if constexpr (requires { { D->getTemplateSpecializationKind () } ->
579
- std::same_as<TemplateSpecializationKind>; })
580
- return D->getTemplateSpecializationKind () ==
581
- TemplateSpecializationKind::TSK_ImplicitInstantiation;
582
- else
583
- return false ;
584
- }
585
-
586
572
bool
587
573
ASTVisitor::
588
574
extractInfo (
@@ -1198,10 +1184,6 @@ Traverse(
1198
1184
AccessSpecifier A,
1199
1185
std::unique_ptr<TemplateInfo>&& Template = nullptr )
1200
1186
{
1201
- // implicit instantiations should *only* have their Info
1202
- // extracted via buildSpecialization calls from getParentNamespaces
1203
- if (isImplicitInstantiation (D))
1204
- return true ;
1205
1187
if (! shouldExtract (D))
1206
1188
return true ;
1207
1189
@@ -1258,13 +1240,6 @@ Traverse(
1258
1240
AccessSpecifier A,
1259
1241
std::unique_ptr<TemplateInfo>&& Template = nullptr )
1260
1242
{
1261
- // implicitly instantiated definitions of non-inline
1262
- // static data members of class templates are added to
1263
- // the end of the TU DeclContext. Decl::isImplicit returns
1264
- // false for these VarDecls, so we must check whether this
1265
- // variable is an implicit instantiation & skip such Decls
1266
- if (isImplicitInstantiation (D))
1267
- return true ;
1268
1243
if (! shouldExtract (D))
1269
1244
return true ;
1270
1245
@@ -1283,8 +1258,6 @@ Traverse(
1283
1258
AccessSpecifier A,
1284
1259
std::unique_ptr<TemplateInfo>&& Template = nullptr )
1285
1260
{
1286
- if (isImplicitInstantiation (D))
1287
- return true ;
1288
1261
if (! shouldExtract (D))
1289
1262
return true ;
1290
1263
@@ -1304,8 +1277,6 @@ Traverse(
1304
1277
AccessSpecifier A,
1305
1278
std::unique_ptr<TemplateInfo>&& Template = nullptr )
1306
1279
{
1307
- if (isImplicitInstantiation (D))
1308
- return true ;
1309
1280
if (! shouldExtract (D))
1310
1281
return true ;
1311
1282
@@ -1331,8 +1302,6 @@ Traverse(
1331
1302
if(DN)
1332
1303
s = DN.getAsString();
1333
1304
*/
1334
- if (isImplicitInstantiation (D))
1335
- return true ;
1336
1305
if (! shouldExtract (D))
1337
1306
return true ;
1338
1307
@@ -1351,8 +1320,6 @@ Traverse(
1351
1320
AccessSpecifier A,
1352
1321
std::unique_ptr<TemplateInfo>&& Template = nullptr )
1353
1322
{
1354
- if (isImplicitInstantiation (D))
1355
- return true ;
1356
1323
if (! shouldExtract (D))
1357
1324
return true ;
1358
1325
@@ -1371,8 +1338,6 @@ Traverse(
1371
1338
AccessSpecifier A,
1372
1339
std::unique_ptr<TemplateInfo>&& Template = nullptr )
1373
1340
{
1374
- if (isImplicitInstantiation (D))
1375
- return true ;
1376
1341
if (! shouldExtract (D))
1377
1342
return true ;
1378
1343
@@ -1387,8 +1352,6 @@ Traverse(
1387
1352
CXXDestructorDecl* D,
1388
1353
AccessSpecifier A)
1389
1354
{
1390
- if (isImplicitInstantiation (D))
1391
- return true ;
1392
1355
if (! shouldExtract (D))
1393
1356
return true ;
1394
1357
@@ -1415,8 +1378,6 @@ Traverse(
1415
1378
EnumDecl* D,
1416
1379
AccessSpecifier A)
1417
1380
{
1418
- if (isImplicitInstantiation (D))
1419
- return true ;
1420
1381
if (! shouldExtract (D))
1421
1382
return true ;
1422
1383
@@ -1812,5 +1773,23 @@ ForgetSema()
1812
1773
sema_ = nullptr ;
1813
1774
}
1814
1775
1776
+ void
1777
+ ASTVisitor::
1778
+ HandleCXXStaticMemberVarInstantiation (VarDecl* D)
1779
+ {
1780
+ // implicitly instantiated definitions of non-inline
1781
+ // static data members of class templates are added to
1782
+ // the end of the TU DeclContext. Decl::isImplicit returns
1783
+ // false for these VarDecls, so we manually set it here.
1784
+ D->setImplicit ();
1785
+ }
1786
+
1787
+ void
1788
+ ASTVisitor::
1789
+ HandleCXXImplicitFunctionInstantiation (FunctionDecl* D)
1790
+ {
1791
+ D->setImplicit ();
1792
+ }
1793
+
1815
1794
} // mrdox
1816
1795
} // clang
0 commit comments