[LLVMbugs] [Bug 19104] New: [Windows] Incorrect handling of virtual methods with explicit base specification

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 11 00:52:14 PDT 2014


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

            Bug ID: 19104
           Summary: [Windows] Incorrect handling of virtual methods with
                    explicit base specification
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: timurrrr at google.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

(From PR18967)
--------------------------
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 C::foo(); }
  int d;
};
int main() {
  D d;
  printf("%d\n", d.bar());
  return 0;
}
--------------------------

Prints "3" when built with clang, should print "2".

-- 
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/20140311/422685d0/attachment.html>


More information about the llvm-bugs mailing list