From 708aabd3ef5401b57ef13d1c9dd812bf3b62452f Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Sat, 20 Jun 2015 00:06:30 +0000 Subject: [PATCH] Suppress bogus gcc -Wreturn-type warnings. llvm-svn: 240199 --- clang/include/clang/AST/Type.h | 1 + clang/lib/AST/Type.cpp | 1 + clang/lib/Basic/IdentifierTable.cpp | 1 + clang/lib/Sema/SemaType.cpp | 1 + 4 files changed, 4 insertions(+) diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h index d82125873623..d903b9d8cbcf 100644 --- a/clang/include/clang/AST/Type.h +++ b/clang/include/clang/AST/Type.h @@ -3544,6 +3544,7 @@ public: case NullabilityKind::Unspecified: return attr_null_unspecified; } + llvm_unreachable("Unknown nullability kind."); } /// Strip off the top-level nullability annotation on the given diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp index 15f3d39634d3..3ac117194099 100644 --- a/clang/lib/AST/Type.cpp +++ b/clang/lib/AST/Type.cpp @@ -2466,6 +2466,7 @@ bool Type::canHaveNullability() const { case Type::Atomic: return false; } + llvm_unreachable("bad type kind!"); } llvm::Optional AttributedType::getImmediateNullability() const { diff --git a/clang/lib/Basic/IdentifierTable.cpp b/clang/lib/Basic/IdentifierTable.cpp index 0349ef463bf5..b29500810003 100644 --- a/clang/lib/Basic/IdentifierTable.cpp +++ b/clang/lib/Basic/IdentifierTable.cpp @@ -658,4 +658,5 @@ StringRef clang::getNullabilitySpelling(NullabilityKind kind) { case NullabilityKind::Unspecified: return "__null_unspecified"; } + llvm_unreachable("Unknown nullability kind."); } diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 44c925778cbf..ff0e26c8402c 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -2581,6 +2581,7 @@ IdentifierInfo *Sema::getNullabilityKeyword(NullabilityKind nullability) { Ident___null_unspecified = PP.getIdentifierInfo("__null_unspecified"); return Ident___null_unspecified; } + llvm_unreachable("Unknown nullability kind."); } /// Retrieve the identifier "NSError".