This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/32549] New: Wrong template instance resolution among multiple object files.
- From: "opichals at seznam dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jun 2007 17:44:23 -0000
- Subject: [Bug c++/32549] New: Wrong template instance resolution among multiple object files.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
There seems to be something inconsistent in the g++ template
instantiation.
When a template is instantiated with an argument of the same
name in two object files in which the argument type is different
(unlike their names). It appears that even though that those
instances should have been distinct g++ resolves them into a
single one which appears to be wrong.
Please see the attached reproduction code. The code of the
template only prints the sizeof() of its (template) argument.
The argument if places in a global namespace in each of the
object files is considered to be the same no matter of its
size or structure (as long as it is of the same name).
I have reproduced the gcc 3.4.6 and gcc 4.0.1 to behave the
same in this aspect (see the attached test output files).
--
Summary: Wrong template instance resolution among multiple object
files.
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: opichals at seznam dot cz
GCC build triplet: x86
GCC host triplet: x86
GCC target triplet: x86
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32549