1 // Copyright (c) 2012 Google Inc. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 template <bool> 6 struct CompileAssert { 7 }; 8 9 #define COMPILE_ASSERT(expr, msg) \ 10 typedef CompileAssert<(bool(expr))> msg[bool(expr) ? 1 : -1] 11 12 int main() { 13 COMPILE_ASSERT(char(-1) > 0, default_char_is_unsigned); 14 return 0; 15 } 16