[llvm-bugs] [Bug 25370] New: [ms] Miscompile with explicit call of default construct of virtual base

via llvm-bugs llvm-bugs at lists.llvm.org
Sun Nov 1 12:31:04 PST 2015


https://llvm.org/bugs/show_bug.cgi?id=25370

            Bug ID: 25370
           Summary: [ms] Miscompile with explicit call of default
                    construct of virtual base
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider:

struct Test {
  virtual ~Test() {}
};

struct BrowserTest : virtual public Test {};

struct NonsecureURLRequestTest : public BrowserTest {
  NonsecureURLRequestTest() : BrowserTest() {}
};

int main() {
  new NonsecureURLRequestTest();
}

> clang-cl foo.cc -m32
> foo

This crashes. (With or without optimizations, 32-bit and 64-bit.)



If NonsecureURLRequestTest is defined like so

struct NonsecureURLRequestTest : public BrowserTest {
  NonsecureURLRequestTest() {}
};


then everything works fine.

This causes the test failure in http://crbug.com/549765

-- 
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/20151101/9ff502de/attachment.html>


More information about the llvm-bugs mailing list