public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32549]  New: Wrong template instance resolution among multiple object files.
@ 2007-06-29 17:44 opichals at seznam dot cz
  2007-06-29 17:46 ` [Bug c++/32549] " opichals at seznam dot cz
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: opichals at seznam dot cz @ 2007-06-29 17:44 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-09-17 11:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-29 17:44 [Bug c++/32549] New: Wrong template instance resolution among multiple object files opichals at seznam dot cz
2007-06-29 17:46 ` [Bug c++/32549] " opichals at seznam dot cz
2007-06-29 19:46 ` pinskia at gcc dot gnu dot org
2007-06-30 15:05 ` opichals at seznam dot cz
2007-09-08 23:53 ` bangerth at dealii dot org
2007-09-17 11:36 ` opichals at seznam dot cz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).