[PATCH] D41179: [Sema] Diagnose template specializations with C linkage

Roger Ferrer Ibanez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 13 08:32:23 PST 2017

rogfer01 added inline comments.

Comment at: lib/Sema/SemaTemplate.cpp:7021
+  // C++ [temp]p6:
+  //   A template, a template explicit specialization, and a class template
+  //   partial specialization shall not have C linkage.
Can you add a test for a partial specialization? Your test for the class case only includes an explicit specialization.

template <typename T>
struct A { };

extern "C" { 

template <typename T>   // I'd expect a diagnostic around here
struct A<T*>



More information about the cfe-commits mailing list