xref: /minix3/external/bsd/llvm/dist/clang/test/SemaCXX/member-pointer-size.cpp (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-unknown-unknown %s -fsyntax-only -verify
2*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple i686-unknown-unknown %s -fsyntax-only -verify
3*f4a2713aSLionel Sambuc // expected-no-diagnostics
4*f4a2713aSLionel Sambuc #include <stddef.h>
5*f4a2713aSLionel Sambuc 
6*f4a2713aSLionel Sambuc struct A;
7*f4a2713aSLionel Sambuc 
f()8*f4a2713aSLionel Sambuc void f() {
9*f4a2713aSLionel Sambuc   int A::*dataMember;
10*f4a2713aSLionel Sambuc 
11*f4a2713aSLionel Sambuc   int (A::*memberFunction)();
12*f4a2713aSLionel Sambuc 
13*f4a2713aSLionel Sambuc   typedef int assert1[sizeof(dataMember) == sizeof(ptrdiff_t) ? 1 : -1];
14*f4a2713aSLionel Sambuc   typedef int assert2[sizeof(memberFunction) == sizeof(ptrdiff_t) * 2 ? 1 : -1];
15*f4a2713aSLionel Sambuc }
16*f4a2713aSLionel Sambuc 
17