This is currently copied from http://quickgit.kde.org/index.php?p=scratch%2Fdakon%2Fcmake-cxx11.git but there is a chance that in future it will be merged into CMake proper.
15 lines
224 B
C++
15 lines
224 B
C++
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;
|
|
}
|