Skip to content

Commit 90a2e0b

Browse files
committed
[clang] Silence GCC warnings about control reaching end of non void function
This fixes GCC warnings since e7f782e.
1 parent 50d2b6a commit 90a2e0b

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
@@ -7331,6 +7331,7 @@ static bool diagnoseDiagnoseIfAttrsWith(Sema &S, const NamedDecl *ND,
73317331
case DiagnoseIfAttr::DS_error:
73327332
return diag::Severity::Error;
73337333
}
7334+
llvm_unreachable("Fully covered switch above!");
73347335
};
73357336

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

0 commit comments

Comments
 (0)