[clang] 8ed9c61 - [NFC] Remove unneeded forward declaration of diagnoseUncapturableValueReferenceOrBinding() (#154591)

via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 20 11:57:57 PDT 2025


Author: Tom Honermann
Date: 2025-08-20T14:57:53-04:00
New Revision: 8ed9c6101f2307991f77f9126904c8c050288c06

URL: https://github.com/llvm/llvm-project/commit/8ed9c6101f2307991f77f9126904c8c050288c06
DIFF: https://github.com/llvm/llvm-project/commit/8ed9c6101f2307991f77f9126904c8c050288c06.diff

LOG: [NFC] Remove unneeded forward declaration of diagnoseUncapturableValueReferenceOrBinding() (#154591)

The only (remaining) use of this forward declaration was removed in
commit 127bf44385424891eb04cff8e52d3f157fc2cb7c.

Added: 
    

Modified: 
    clang/lib/Sema/SemaExpr.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index dcd70e6769e23..911c80adfd539 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -3255,10 +3255,6 @@ ExprResult Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS,
   return ULE;
 }
 
-static void diagnoseUncapturableValueReferenceOrBinding(Sema &S,
-                                                        SourceLocation loc,
-                                                        ValueDecl *var);
-
 ExprResult Sema::BuildDeclarationNameExpr(
     const CXXScopeSpec &SS, const DeclarationNameInfo &NameInfo, NamedDecl *D,
     NamedDecl *FoundD, const TemplateArgumentListInfo *TemplateArgs,
@@ -18659,8 +18655,9 @@ void Sema::MarkCaptureUsedInEnclosingContext(ValueDecl *Capture,
   MarkVarDeclODRUsed(Capture, Loc, *this, &CapturingScopeIndex);
 }
 
-void diagnoseUncapturableValueReferenceOrBinding(Sema &S, SourceLocation loc,
-                                                 ValueDecl *var) {
+static void diagnoseUncapturableValueReferenceOrBinding(Sema &S,
+                                                        SourceLocation loc,
+                                                        ValueDecl *var) {
   DeclContext *VarDC = var->getDeclContext();
 
   //  If the parameter still belongs to the translation unit, then


        


More information about the cfe-commits mailing list