+++ This bug was initially created as a clone of Bug #32734 +++ While attempting to compile Xerces 2.7 on MacOS, I discovered what I think is a bug in gcc, which I'm using for all phases of build. The c++ preprocessor is emitting line number statements which have an inconsistent number of arguments after the file name, e.g.:
# 1 "/usr/include/xercesc/util/XMLEnumerator.hpp" 1 3 4 vs. # 25 "/usr/include/xercesc/util/XMLEnumerator.hpp" 3 4 and, in the former case (with the extra number), it seems to introduce some compiler behavior where a subsequent template class definition will be rejected with the misguiding error message "template with C linkage". I have whittled the problem down to a single preprocessed source file that exhibits this problem - will try to attach it once I can figure out Bugzilla's UI. Thanks for your help and advice! Alan This problem still exists in 4.2.2 and is still bogus. -- Summary: bogus "template with C linkage" from erroneous #line directives Product: gcc Version: 4.2.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: goffster at gmail dot com GCC host triplet: Mac OS 10.4 GCC target triplet: native http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34009