[clang] 79c11ef - [clang-format][NFC] Remove redundant checking for null pointer

Owen Pan via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 9 19:58:34 PST 2026


Author: Owen Pan
Date: 2026-01-09T19:58:22-08:00
New Revision: 79c11ef40ce34401d52ce07b2f070fa3e9557781

URL: https://github.com/llvm/llvm-project/commit/79c11ef40ce34401d52ce07b2f070fa3e9557781
DIFF: https://github.com/llvm/llvm-project/commit/79c11ef40ce34401d52ce07b2f070fa3e9557781.diff

LOG: [clang-format][NFC] Remove redundant checking for null pointer

See https://github.com/llvm/llvm-project/pull/143194#discussion_r2674008700

Added: 
    

Modified: 
    clang/lib/Format/TokenAnnotator.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index 2b554e609fa3a..3208d8e28dd86 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -3758,9 +3758,6 @@ static FormatToken *getFunctionName(const AnnotatedLine &Line,
     while (auto *Next = skipNameQualifier(Tok))
       Tok = Next;
 
-    if (!Tok)
-      return nullptr;
-
     // Skip the `~` if a destructor name.
     if (Tok->is(tok::tilde)) {
       Tok = Tok->Next;


        


More information about the cfe-commits mailing list