Skip to content

Commit 7d11f52

Browse files
committed
[clang] Silence GCC warnings about control reaching end of non void function
This fixes GCC warnings since e392056.
1 parent f66509b commit 7d11f52

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

clang/include/clang/Basic/DiagnosticIDs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "clang/Basic/LLVM.h"
1919
#include "llvm/ADT/IntrusiveRefCntPtr.h"
2020
#include "llvm/ADT/StringRef.h"
21+
#include "llvm/Support/ErrorHandling.h"
2122
#include <optional>
2223
#include <vector>
2324

@@ -310,6 +311,7 @@ class DiagnosticIDs : public RefCountedBase<DiagnosticIDs> {
310311
return {diag::Severity::Fatal, std::string(Message), CLASS_ERROR,
311312
/*ShowInSystemHeader*/ true};
312313
}
314+
llvm_unreachable("Fully covered switch above!");
313315
}());
314316
}
315317

clang/lib/Sema/SemaOverload.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7324,6 +7324,7 @@ static bool diagnoseDiagnoseIfAttrsWith(Sema &S, const NamedDecl *ND,
73247324
case DiagnoseIfAttr::DS_error:
73257325
return diag::Severity::Error;
73267326
}
7327+
llvm_unreachable("Fully covered switch above!");
73277328
};
73287329

73297330
for (const auto *DIA : llvm::make_range(WarningBegin, Attrs.end()))

0 commit comments

Comments
 (0)