[LLVMbugs] [Bug 23165] New: abort with "pure virtual method called", when a virtual function is called on a POD temporary passed as an argument (in program compiled w/ clang trunk -std=c++11)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 8 18:46:58 PDT 2015


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

            Bug ID: 23165
           Summary: abort with "pure virtual method called", when a
                    virtual function is called on a POD temporary passed
                    as an argument (in program compiled w/ clang trunk
                    -std=c++11)
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dholbert at mozilla.com
                CC: dgregor at apple.com, llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 14171
  --> https://llvm.org/bugs/attachment.cgi?id=14171&action=edit
C++ testcase

STR:
 1. Compile attached program using clang 3.7 with -std=c++11:
     clang++-3.7 -std=c++11 test.cpp

   (Or use -std=gnu++0x)

 2. Run the resulting a.out

ACTUAL RESULTS:
The program aborts with:
> pure virtual method called
> terminate called without an active exception
> Aborted (core dumped)

EXPECTED RESULTS:
No abort; virtual function should run successfully.

I get EXPECTED RESULTS if I drop the "-std=c++11" command-line argument. I also
get EXPECTED RESULTS from clang++-3.6 (with the c++11 command-line argument
included).  So this is a regression, or at least a behavior-change.

-- 
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/20150409/fbcbfae5/attachment.html>


More information about the llvm-bugs mailing list