[PATCH] MS ABI: Treat dllimport explicit specializations as inline
Richard Smith
richard at metafoo.co.uk
Thu May 29 14:25:42 PDT 2014
On Fri, May 23, 2014 at 6:37 PM, Hans Wennborg <hans at chromium.org> wrote:
> On Fri, May 23, 2014 at 3:06 AM, Nico Rieck <nico.rieck at gmail.com> wrote:
> > MSVC allows
> >
> > template<typename T> void f() {}
> > template<> __declspec(dllimport) void f<int>() {}
> >
> > without f<int> being specified as inline. This only works with dllimport
> > and seems to have no effect on linkage without it.
>
> I think the functionality looks good, but I'm worried that this seems
> more like a semantic property than an ABI property. I'd like to hear
> Reid or Richard's opinion.
I find it a bit weird that we care in CodeGen whether a dllimport function
is marked as 'inline'. I would expect that either Sema should detect the
attribute has no effect and discard it, or it should keep it (and in the
latter case, CodeGen should respect it and not care whether the function is
marked 'inline'). Is there some reason that doesn't work?
Also... what linkage would MSVC give to an explicit specialization of a
function template under normal circumstances (no dllimport/dllexport
attributes)? Does it treat them as mergeable, like an inline function, or
as a strong definition? (Maybe that's what we should base this decision on.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140529/855ac0f8/attachment.html>
More information about the cfe-commits
mailing list