[LLVMbugs] [Bug 7415] New: clang c++ emits unnecessary definition of static member of template class

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 18 19:57:05 PDT 2010


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

           Summary: clang c++ emits unnecessary definition of static
                    member of template class
           Product: clang
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com
        Depends on: 5511


Testcase:
class X {
  template <class Dummy> struct COMTypeInfo {
    static const int kIID;
  };
  static const int& GetIID() {return COMTypeInfo<int>::kIID;}
};
template <class Dummy> const int X::COMTypeInfo<Dummy>::kIID = 10;


clang outputs _ZN1X11COMTypeInfoIiE4kIIDE; g++ doesn't.

This pattern is used heavily in Firefox.

-- 
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