[clang] cab3c6c - [clang][TargetCXXABI] Fix -Wreturn-type warning (NFC)

Yang Fan via cfe-commits cfe-commits at lists.llvm.org
Tue May 4 23:45:12 PDT 2021


Author: Yang Fan
Date: 2021-05-05T14:44:48+08:00
New Revision: cab3c6c6c48ed0da0f047bdc1a337d991c78ad8c

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

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

GCC warning:
```
In file included from /llvm-project/clang/include/clang/Basic/LangOptions.h:22,
                 from /llvm-project/clang/include/clang/Frontend/CompilerInvocation.h:16,
                 from /llvm-project/clang/lib/Frontend/CompilerInvocation.cpp:9:
/llvm-project/clang/include/clang/Basic/TargetCXXABI.h: In static member function ‘static bool clang::TargetCXXABI::isSupportedCXXABI(const llvm::Triple&, clang::TargetCXXABI::Kind)’:
/llvm-project/clang/include/clang/Basic/TargetCXXABI.h:114:3: warning: control reaches end of non-void function [-Wreturn-type]
  114 |   };
      |   ^
```

Added: 
    

Modified: 
    clang/include/clang/Basic/TargetCXXABI.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/Basic/TargetCXXABI.h b/clang/include/clang/Basic/TargetCXXABI.h
index 739ade31451e..91189996a4d9 100644
--- a/clang/include/clang/Basic/TargetCXXABI.h
+++ b/clang/include/clang/Basic/TargetCXXABI.h
@@ -111,6 +111,7 @@ class TargetCXXABI {
     case Microsoft:
       return T.isKnownWindowsMSVCEnvironment();
     }
+    llvm_unreachable("invalid CXXABI kind");
   };
 
   /// Does this ABI generally fall into the Itanium family of ABIs?


        


More information about the cfe-commits mailing list