//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <cstddef>

#ifndef offsetof
#error offsetof not defined
#endif

struct A
{
    int x;
};

int main()
{
#if (__has_feature(cxx_noexcept))
    static_assert(noexcept(offsetof(A, x)), "");
#endif
}

//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include <cstddef>

#ifndef offsetof
#error offsetof not defined
#endif

int main()
{
}

--- 
+++ 
@@ -13,6 +13,14 @@
 #error offsetof not defined
 #endif
 
+struct A
+{
+    int x;
+};
+
 int main()
 {
+#if (__has_feature(cxx_noexcept))
+    static_assert(noexcept(offsetof(A, x)), "");
+#endif
 }
Add noexcept test for offsetof macro per [support.types]/p4.

git-svn-id: 756ef344af921d95d562d9e9f9389127a89a6314@159846 91177308-0d34-0410-b5e6-96231b3b80d8
