[llvm-bugs] [Bug 27810] New: [ms] clang-cl emits definitions for methods of inner classes of template classes of the template has a dllimported instantiation declaration

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 18 19:21:27 PDT 2016


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

            Bug ID: 27810
           Summary: [ms] clang-cl emits definitions for methods of inner
                    classes of template classes of the template has a
                    dllimported instantiation declaration
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: unassignedclangbugs at nondot.org
          Reporter: nicolasweber at gmx.de
                CC: dgregor at apple.com, llvm-bugs at lists.llvm.org
    Classification: Unclassified

Consider:

template <class T>
struct basic_ostream {
  struct sentry {
    sentry() {
    }
  };
};
template class __declspec(dllimport) basic_ostream<char>;


clang-cl emits basic_ostream<char>::sentry::sentry() for this. cl doesn't.
clang doesn't emit anything if this is an "extern template class". dllimported
instantiation declarations should probably do something similar to extern
templates in non-microsoft mode.


This causes us to emit a bunch of functions into the .obj of every TU that
includes <ostream> with Microsoft's headers, making codegen slower than
necessary.

-- 
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/20160519/d84fcc6a/attachment.html>


More information about the llvm-bugs mailing list