summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/microsoft-abi-vtables-virtual-inheritance-pr18967.cpp
blob: 9df692a83385bd2e3046541944702656a1b73d96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// RUN: not %clang_cc1 -triple i686-pc-win32 -emit-llvm-only -fno-rtti %s 2>&1 | FileCheck %s

// CHECK: error: v-table layout for classes with non-virtual base classes that override methods in virtual bases is not supported yet

struct A {
  virtual int foo() { return a; }
  int a;
};
struct B : virtual A {
  B() : b(1) {}
  virtual int bar() { return b; }
  int b;
};
struct C : virtual A {
  C() : c(2) {}
  virtual int foo() { return c; }
  int c;
};
struct D : B, C {
  D() : d(3) {}
  virtual int bar() { return d; }
  int d;
};
int main() {
  D d;
  return d.foo();
}
OpenPOWER on IntegriCloud