forked from OSchip/llvm-project
[Basic] Use a static_assert instead of using the old array of size -1 trick.
llvm-svn: 305439
This commit is contained in:
parent
6ea89f2497
commit
210a787f29
|
@ -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 };
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue