An anonymous namespace in an include file contains a template. I precompile the include file. Now all C++ source files that include the precompiled header file share the same anonymous namespace. In the attached example, two (identical) source file include the precompiled header and then define an integer "i" within an anonymous namespace. The linker should know that each of these integers are invisible outside of its source file, but instead complains about a symbol that is defined twice.
-- Summary: template in anonymous namespace in precompiled header Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: hans at jukesan dot de CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: g++ 4.0.0 GCC host triplet: Pentium 32-bit GCC target triplet: Suse Linux 9.2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21179