This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH: PR 24687


On Nov 14, 2005, at 4:17 PM, Mark Mitchell wrote:
You're not allowed to create a template with extern "C" linkage

+  /* [temp]
+
+     A template ... explicit specialization ... shall not have C
+     linkage.  */
+  if (current_lang_name == lang_name_c)
+    {
+      error ("template specialization with C linkage");

+  /* [temp]
+
+     A template ... shall not have C linkage.  */
+  if (current_lang_name == lang_name_c)
+    {
+      error ("template with C linkage");

It might be an improvement to name the open extern "C" { line, if any, that the linkage came from, as people have a habit of


extern "C" {
#include <files.h>
}

in headerfiles, and tracking down which one is apparently hard for some users. In emacs, it is just M-backward-up-list (aka M-C-u) in the preprocessed file. This is kinda rare, but happens once every couple of years still. :-(


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]