[LLVMbugs] [Bug 17273] New: [-cxx-abi microsoft] Complete destructors for class templates instantiated with objects from an anonymous namespace should be internal

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Sep 17 13:32:45 PDT 2013


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

            Bug ID: 17273
           Summary: [-cxx-abi microsoft] Complete destructors for class
                    templates instantiated with objects from an anonymous
                    namespace should be internal
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: rnk at google.com
          Reporter: rnk at google.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Here's an example from Chrome:

Undecoration of :-
"??_G?$BindState at V?$RunnableAdapter at P8PlatformAppPathLauncher@?A at apps@@AEXABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@Z at internal@base@@$$A6AXPAVPlatformAppPathLauncher@?A at apps@@ABV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@Z$$A6AX0V67@@Z at internal@base@@UAEPAXI at Z"


is :- "public: virtual void * __thiscall base::internal::BindState<class
base::internal::RunnableAdapter<void (__thiscall apps::`anonymous
namespace'::PlatformAppPathLauncher::*)(class std::basic_string<char,struct
std::char_traits<char>,class std::allocator<char> > const &)>,void
__cdecl(class apps::`anonymous namespace'::PlatformAppPathLauncher *,class
std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
> const &),void __cdecl(class apps::`anonymous
namespace'::PlatformAppPathLauncher *,class basic_string<char,struct
std::char_traits<char>,class std::allocator<char> >::apps)>::`scalar deleting
destructor'(unsigned int)"


Basically this code I wrote is wrong:

llvm::GlobalValue::LinkageTypes
CodeGenModule::getFunctionLinkage(GlobalDecl GD) {
  const FunctionDecl *D = cast<FunctionDecl>(GD.getDecl());

  if (isa<CXXDestructorDecl>(D) &&
      getCXXABI().useThunkForDtorVariant(cast<CXXDestructorDecl>(D),
                                         GD.getDtorType()))
    return llvm::Function::LinkOnceODRLinkage;


As an aside, Microsoft leaves these instantiations external.  Instead they
invent unique names for anonymous namespaces.  This is a big source of COFF
symbol differences between clang and cl.exe.

-- 
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/20130917/89cbfac4/attachment.html>


More information about the llvm-bugs mailing list