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?
 Maybe the right thing is to use a comparison that knows how to overlook
implicit CC differences, but knows about explicit CC differences.


On Thu, Dec 5, 2013 at 1:25 PM, Rafael Espíndola <[email protected]
> wrote:

> The attached patch fixes pr18141 by taking the calling convention into
> consideration when looking for which member is being specialized.
>
> Without this patch clang falls of
>
>   if (!Instantiation) {
>     // There is no previous declaration that matches. Since member
>     // specializations are always out-of-line, the caller will complain
> about
>     // this mismatch later.
>     return false;
>   }
>
> But nothing complains, so there might be something else wrong in here.
>
> Cheers,
> Rafael
>
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to