member-pointer-size.cpp revision a5728872c7702ddd09537c95bc3cbd20e1f2fb09
1// RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify
2// RUN: %clang_cc1 -triple i686-unknown-unknown %s -fsyntax-only -verify
3#include <stddef.h>
4
5struct A;
6
7void f() {
8  int A::*dataMember;
9
10  int (A::*memberFunction)();
11
12  typedef int assert1[sizeof(dataMember) == sizeof(ptrdiff_t) ? 1 : -1];
13  typedef int assert2[sizeof(memberFunction) == sizeof(ptrdiff_t) * 2 ? 1 : -1];
14}
15
16