On 5 December 2013 17:23, Reid Kleckner <[email protected]> wrote: > What happens for an invalid test case like: > > template <typename T> > struct S { > void f(T t) { > t = 42; > } > }; > template<> void __cdecl S<void*>::f(void*); > void g(S<void*> s, void* p) { > s.f(p); > } > > MSVC rejects this with "error C2373: 'S<T>::f' : redefinition; different > type modifiers". Do we just paper that over and adjust to __thiscall?
With the previous patch we would still produce an error:
/Users/respindola/llvm/test.cpp:7:35: error: function declared 'cdecl'
here was previously declared 'thiscall'
template<> void __cdecl S<void*>::f(void*);
^
/Users/respindola/llvm/test.cpp:7:35: note: previous declaration is here
but clang was clearly getting confused as show by the note on the same
line as the error.
> Maybe the right thing is to use a comparison that knows how to overlook
> implicit CC differences, but knows about explicit CC differences.
The attached patch does that. With it clang prints an error about the
__cdecl, ignores the broken specialization and continues.
Cheers,
Rafael
t.patch
Description: Binary data
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
