1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // UNSUPPORTED: c++98, c++03 11 12 #include <cstddef> 13 14 #include "test_macros.h" 15 16 #ifndef offsetof 17 #error offsetof not defined 18 #endif 19 20 struct A 21 { 22 int x; 23 }; 24 25 int main() 26 { 27 static_assert(noexcept(offsetof(A, x)), ""); 28 } 29