[llvm-bugs] [Bug 43079] New: clang calls the base object constructor (c2), gcc calls the complete object constructor (c1)

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 21 14:25:47 PDT 2019


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

            Bug ID: 43079
           Summary: clang  calls the base object constructor (c2), gcc
                    calls the complete object constructor (c1)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: rafael at espindo.la
                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

With libstdc++ 9.1 and

#include <filesystem>
void foo() {
    for (auto& dev : std::filesystem::directory_iterator("slaves")) {
    }
}

clang calls
_ZNSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE2EEC2EOS5_
and gcc calls
_ZNSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE2EEC1EOS5_.

This is a problem because libstdc++ has

  extern template class
    __shared_ptr<filesystem::_Dir>;

but only
_ZNSt12__shared_ptrINSt10filesystem7__cxx114_DirELN9__gnu_cxx12_Lock_policyE2EEC1
is exported in the .so.

-- 
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/20190821/6dc7fec8/attachment.html>


More information about the llvm-bugs mailing list