cmake/c++11-test-sizeof_member-N2253.cpp

changeset 473
2a84149fe642
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/cmake/c++11-test-sizeof_member-N2253.cpp	Thu Aug 22 20:24:16 2013 +0300
@@ -0,0 +1,14 @@
+struct foo {
+	char bar;
+	int baz;
+};
+
+int main(void)
+{
+	bool ret = (
+		(sizeof(foo::bar) == 1) &&
+		(sizeof(foo::baz) >= sizeof(foo::bar)) &&
+		(sizeof(foo) >= sizeof(foo::bar)+sizeof(foo::baz))
+	);
+	return ret ? 0 : 1;
+}

mercurial