1 // (C) Copyright Steve Cleary & John Maddock 2000. 2 // Use, modification and distribution are subject to the 3 // Boost Software License, Version 1.0. (See accompanying file 4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 // See http://www.boost.org for most recent version including documentation. 7 8 #include <boost/config.hpp> 9 #include <boost/static_assert.hpp> 10 11 // 12 // all these tests should fail: 13 // 14 15 16 struct Bob 17 { 18 public: 19 20 // Member function scope: provides access to member variables 21 char x[4]; 22 char c; fBob23 int f() 24 { 25 #if !defined(BOOST_MSVC) || BOOST_MSVC > 1200 // broken sizeof in VC6 26 BOOST_STATIC_ASSERT(sizeof(x) == 4); 27 BOOST_STATIC_ASSERT(sizeof(c) == 1); 28 BOOST_STATIC_ASSERT((sizeof(x) == sizeof(c))); // should not compile 29 #endif 30 return x; 31 } 32 }; 33 34 35 36 37 38 39