[LLVMbugs] [Bug 8177] New: Clang differs from GCC in how it deals with vtables in combination with limited symbol visibility, causing link errors

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat Sep 18 04:28:05 PDT 2010


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

           Summary: Clang differs from GCC in how it deals with vtables in
                    combination with limited symbol visibility, causing
                    link errors
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: tor.arne.vestbo at nokia.com
                CC: llvmbugs at cs.uiuc.edu


It seems as Clang differs from GCC in how it deals with vtables in combination
with limited symbol visibility, causing link errors. The following test case
exhibits the issue:

http://gist.github.com/584533

The template class has one exported member function, which is implicitly
instantiated for <Foo> in foo.cpp. The class itself is not exported.

GCC will in this case not include a vtable for TemplateClass<Foo> in the shared
library, and the vtable is generated when building the client application.

For Clang the vtable is included in the shared library, but it's not exported,
so when building the client application a vtable is not generated, and you'll
get an error when linking that the vtable for TemplateClass<Foo> is missing.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list