[LLVMbugs] [Bug 19519] MS ABI: adjustor vs vtordisp thunk emitted

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 23 03:13:37 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=19519

Timur Iskhodzhanov <timurrrr at google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #1 from Timur Iskhodzhanov <timurrrr at google.com> ---
CL from VS2013 seems to do the wrong thing:
----------------------
#include <assert.h>
#include <stdio.h>

struct A {
  virtual void f() {}
  virtual void g() {}
};

struct B : virtual A {
  virtual void g() {}
  B();
};

B::B() {}

struct C : virtual A {
  virtual void f();
  int c;
};

struct D : B, C {
  D();
};

void zoo(C *obj) {
  obj->f();
}

void C::f() {
  assert(c == 42);
}

D::D() {
  c = 42;
  zoo(this);
}

struct E : D {
  // E appends a field at the end of D, thus the offset of A in C increases.
  int x;
};

int main() {
  E e;
  printf("OK\n");
}
----------------------
-> this passes under clang-cl (and g++ on Linux)
but fails the assertion when built with CL.

See also PR19475.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140423/08ddbe3c/attachment.html>


More information about the llvm-bugs mailing list