faisalv added a comment. In https://reviews.llvm.org/D41179#964522, @miyuki wrote:
> In https://reviews.llvm.org/D41179#957992, @sepavloff wrote: > > > Classes do not have language linkage according to 10.5p1, just as > > templates, so this code is valid. > > > > It looks like defining templates inside extern "C" blocks is OK. > > > Currently both Clang and GCC diagnose class templates declared inside an > 'extern "C"' block. I'm not sure how to proceed about this. Given that Clause 17 p6 specifically uses 'shall' to call out templates - i believe the implementation is expected to diagnose this. 10.5p1 (or is there another mention in the standard?) does not explicitly call out 'classes' as not having c language linkage - so implementations can get away not diagnosing this - and perhaps even allow classes to have language linkage on certain implementations?? (at least that's my squinty interpretation) https://reviews.llvm.org/D41179 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits