[clang-tools-extra] 889da99 - [clang][AST] Fix Wreturn-type gcc warning (NFC)

Yang Fan via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 4 19:25:34 PST 2021


Author: Yang Fan
Date: 2021-03-05T11:24:55+08:00
New Revision: 889da99523930e81e4080084ab9530251c23873d

URL: https://github.com/llvm/llvm-project/commit/889da99523930e81e4080084ab9530251c23873d
DIFF: https://github.com/llvm/llvm-project/commit/889da99523930e81e4080084ab9530251c23873d.diff

LOG: [clang][AST] Fix Wreturn-type gcc warning (NFC)

GCC warning:
```
/llvm-project/clang-tools-extra/clangd/SemanticHighlighting.cpp: In function ‘bool clang::clangd::{anonymous}::canHighlightName(clang::DeclarationName)’:
/llvm-project/clang-tools-extra/clangd/SemanticHighlighting.cpp:64:1: warning: control reaches end of non-void function [-Wreturn-type]
   64 | }
      | ^
```

Added: 
    

Modified: 
    clang-tools-extra/clangd/SemanticHighlighting.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/SemanticHighlighting.cpp b/clang-tools-extra/clangd/SemanticHighlighting.cpp
index 9e24b92b0f5c..0b4965c42715 100644
--- a/clang-tools-extra/clangd/SemanticHighlighting.cpp
+++ b/clang-tools-extra/clangd/SemanticHighlighting.cpp
@@ -61,6 +61,7 @@ bool canHighlightName(DeclarationName Name) {
   case DeclarationName::CXXUsingDirective:
     return false;
   }
+  llvm_unreachable("invalid name kind");
 }
 
 llvm::Optional<HighlightingKind> kindForType(const Type *TP);


        


More information about the cfe-commits mailing list