This test program: # 1 "test.cc" # 1 "np.h" 1 # 1 "Math.h" 1 3 4 template<class T> static inline void push(T* element, T** head) { element->m_flink = *head; *head = element; } produces: In file included from test.cc:2: Math.h:1: error: template with C linkage If I delete the "# 1 "Math.h" 1 3 4" then it works. Strangely enough, it also works on different builds of the same version: for example, the native (i386) build, as well as a build targeted to mipsel-netbsdelf, both accept the test program without complaint. The failing compiler's --verbose output is: mips64el-elf-g++ --verbose Using built-in specs. Target: mips64el-elf Configured with: /buildarea/GCC40/gcc-4.0.0/configure --prefix=/usr/local/EQLGCC_v7/mips64el --enable-languages=c,c++ --target=mips64el-elf --with-newlib --with-arch=sb1 --with-tune=sb1 --with-gnu-as --with-gnu-ld Thread model: single gcc version 4.0.0
This is a target problem, it is not defining NO_IMPLICIT_EXTERN_C.
Thanks. I added that to config/mips/elf.h and it works correctly now.
OK, I'll run that change through dejagnu and commit if there are no problems.
Subject: Bug 21656 CVSROOT: /cvs/gcc Module name: gcc Changes by: rsandifo@gcc.gnu.org 2005-07-09 08:46:35 Modified files: gcc : ChangeLog gcc/config/mips: elf.h Log message: PR target/21656 * config/mips/elf.h (NO_IMPLICIT_EXTERN_C): Define. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.9392&r2=2.9393 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/mips/elf.h.diff?cvsroot=gcc&r1=1.63&r2=1.64
Committed to mainline. Let me know if this is a regression from an earlier release. I'll then apply the patch to the appropriate branches. I'll tentatively close this PR as fixed in the meantime.
Sorry, changed "Reported against" field instead of "Target Milestone".