Files
clang-p2996/clang/test/CodeGenCXX/debug-info-ptr-to-member-function.cpp
David Majnemer 34568bc602 [MS ABI, DebugInfo] Omit the size for model-less pointers-to-members
The representation of a pointer-to-member in the MS ABI is governed by
the layout of the relevant class or if a model has been explicitly
specified.  If no model is specified, then an appropriate
"worst-case-scenario" model is implicitly chosen if, and only, if the
pointer-to-member type's representation was needed.

Debug info cannot force a pointer-to-member type to have a
representation so do not try to query the size of such a type unless we
know it is safe to do so.

llvm-svn: 238259
2015-05-26 21:54:24 +00:00

22 lines
753 B
C++

// RUN: %clang_cc1 %s -triple x86_64-apple-darwin -g -emit-llvm -o - | FileCheck -check-prefix=CHECK -check-prefix=DARWIN-X64 %s
// RUN: %clang_cc1 %s -triple x86_64-pc-win32 -g -emit-llvm -o - | FileCheck -check-prefix=CHECK -check-prefix=WIN32-X64 %s
struct T {
int method();
};
void foo(int (T::*method)()) {}
// A pointer to a member function is a pair of function- and this-pointer.
// CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type,
// DARWIN-X64-SAME: size: 128
// WIN32-X64-SAME: size: 64
struct Incomplete;
int (Incomplete::**bar)();
// CHECK: !DIDerivedType(tag: DW_TAG_ptr_to_member_type,
// DARWIN-X64-SAME: size: 128
// WIN32-X64-NOT: size:
// CHECK-SAME: extraData: {{.*}})