[llvm-bugs] [Bug 47786] New: Compiled binary does not invoke specialized constructor

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Oct 9 17:46:31 PDT 2020


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

            Bug ID: 47786
           Summary: Compiled binary does not invoke specialized
                    constructor
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: jjkoshy at gmail.com
                CC: blitzrakete at gmail.com, dgregor at apple.com,
                    erik.pilkington at gmail.com, llvm-bugs at lists.llvm.org,
                    richard-llvm at metafoo.co.uk

Created attachment 24040
  --> https://bugs.llvm.org/attachment.cgi?id=24040&action=edit
Sample program demonstrating the issue

This was reported by my colleague Lucas Wang.

I have attached a sample program from him.

https://godbolt.org/z/n5qPeM also has a copy

The code and comments explain the issue more clearly but in short:
- We have a class template with a deleted copy constructor
- We specialize that class and add back the copy constructor for that class
- The main function should invoke that specialized copy constructor and indeed
compilation fails without it
- However, at runtime, the copy constructor does not get invoked

I'm not sure if this is an ill-formed program but for comparison, gcc does seem
to invoke the constructor.

-- 
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/20201010/a50ddad1/attachment.html>


More information about the llvm-bugs mailing list