From 227001d12eaea3491a528a3a018a8f12632c12cf Mon Sep 17 00:00:00 2001 From: Howard Hinnant Date: Fri, 6 Jul 2012 18:39:01 +0000 Subject: Add noexcept test for offsetof macro per [support.types]/p4. llvm-svn: 159846 --- libcxx/test/language.support/support.types/offsetof.pass.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libcxx/test') diff --git a/libcxx/test/language.support/support.types/offsetof.pass.cpp b/libcxx/test/language.support/support.types/offsetof.pass.cpp index 758f21529ff..e36ac22974f 100644 --- a/libcxx/test/language.support/support.types/offsetof.pass.cpp +++ b/libcxx/test/language.support/support.types/offsetof.pass.cpp @@ -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 } -- cgit v1.2.3