On Fri, May 23, 2014 at 6:37 PM, Hans Wennborg <[email protected]> wrote:
> On Fri, May 23, 2014 at 3:06 AM, Nico Rieck <[email protected]> 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.)
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
