File tree 3 files changed +28
-21
lines changed
3 files changed +28
-21
lines changed Original file line number Diff line number Diff line change @@ -509,23 +509,6 @@ generateID(Decl const* D) const
509
509
return id;
510
510
}
511
511
512
- namespace
513
- {
514
- template <class DeclTy >
515
- bool
516
- isDefinition (DeclTy* D)
517
- {
518
- if constexpr (requires {D->isThisDeclarationADefinition ();})
519
- {
520
- return D->isThisDeclarationADefinition ();
521
- }
522
- else
523
- {
524
- return false ;
525
- }
526
- }
527
- }
528
-
529
512
template <std::derived_from<Decl> DeclTy>
530
513
void
531
514
ASTVisitor::
@@ -560,7 +543,7 @@ populate(SourceInfo& I, DeclTy const* D)
560
543
dynamic_cast <SourceInfo&>(I),
561
544
Loc,
562
545
isDefinition (D),
563
- D-> getASTContext (). getRawCommentForDeclNoCache (D));
546
+ isDocumented (D));
564
547
}
565
548
}
566
549
@@ -3366,7 +3349,7 @@ checkUndocumented(
3366
3349
// Check if the symbol is documented, ensure this symbol is not in the set
3367
3350
// of undocumented symbols in this translation unit and return
3368
3351
// without an error if it is
3369
- if (D-> getASTContext (). getRawCommentForDeclNoCache (D))
3352
+ if (isDocumented (D))
3370
3353
{
3371
3354
if (config_->warnIfUndocumented )
3372
3355
{
Original file line number Diff line number Diff line change @@ -355,7 +355,7 @@ isVirtualMember(Decl const* D)
355
355
}
356
356
357
357
bool
358
- isAnonymousNamespace (const Decl * D)
358
+ isAnonymousNamespace (Decl const * D)
359
359
{
360
360
if (auto const * ND = dyn_cast<NamespaceDecl>(D))
361
361
{
@@ -365,7 +365,7 @@ isAnonymousNamespace(const Decl *D)
365
365
}
366
366
367
367
bool
368
- isStaticFileLevelMember (const Decl * D)
368
+ isStaticFileLevelMember (Decl const * D)
369
369
{
370
370
if (const auto *VD = dyn_cast<VarDecl>(D)) {
371
371
return VD->getStorageClass () == SC_Static && VD->getDeclContext ()->isFileContext ();
@@ -376,5 +376,11 @@ isStaticFileLevelMember(const Decl *D)
376
376
return false ;
377
377
}
378
378
379
+ bool
380
+ isDocumented (Decl const * D)
381
+ {
382
+ return D->getASTContext ().getRawCommentForDeclNoCache (D);
383
+ }
384
+
379
385
380
386
} // clang::mrdocs
Original file line number Diff line number Diff line change @@ -844,6 +844,24 @@ MRDOCS_DECL
844
844
bool
845
845
isStaticFileLevelMember (Decl const *D);
846
846
847
+ MRDOCS_DECL
848
+ bool
849
+ isDocumented (Decl const *D);
850
+
851
+ template <class DeclTy >
852
+ bool
853
+ isDefinition (DeclTy* D)
854
+ {
855
+ if constexpr (requires {D->isThisDeclarationADefinition ();})
856
+ {
857
+ return D->isThisDeclarationADefinition ();
858
+ }
859
+ else
860
+ {
861
+ return false ;
862
+ }
863
+ }
864
+
847
865
#ifdef NDEBUG
848
866
#define MRDOCS_SYMBOL_TRACE (D, C )
849
867
#else
You can’t perform that action at this time.
0 commit comments