mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-27 18:26:06 +00:00

We didn't supporting taking the address of virtual member functions which overrode a method in a virtual base. We simply need to encode the virtual base index in the member pointer. This fixes PR23452. N.B. There is no data member pointer side to this change because taking the address of a virtual bases' data member gives you a member pointer whose type is derived from the virtual bases' type, not the most derived type. llvm-svn: 236962
13 lines
426 B
C++
13 lines
426 B
C++
// RUN: %clang_cc1 -fno-rtti -emit-llvm -triple=i386-pc-win32 -fms-extensions -fms-compatibility -std=c++11 %s -o - | FileCheck %s
|
|
|
|
namespace PR23452 {
|
|
struct A {
|
|
virtual void f();
|
|
};
|
|
struct B : virtual A {
|
|
virtual void f();
|
|
};
|
|
void (B::*MemPtr)(void) = &B::f;
|
|
// CHECK-DAG: @"\01?MemPtr@PR23452@@3P8B@1@AEXXZQ21@" = global { i8*, i32, i32 } { i8* bitcast ({{.*}} @"\01??_9B@PR23452@@$BA@AE" to i8*), i32 0, i32 4 }
|
|
}
|