[Basic] Use a static_assert instead of using the old array of size -1 trick.

llvm-svn: 305439
This commit is contained in:
Craig Topper 2017-06-15 01:27:58 +00:00
parent 6ea89f2497
commit 210a787f29
1 changed files with 1 additions and 1 deletions

View File

@ -28,7 +28,7 @@
namespace clang {
template <size_t SizeOfStr, typename FieldType>
class StringSizerHelper {
char FIELD_TOO_SMALL[SizeOfStr <= FieldType(~0U) ? 1 : -1];
static_assert(SizeOfStr <= FieldType(~0U), "Field too small!");
public:
enum { Size = SizeOfStr };
};