Bug 7877 - Incorrect parameter passing to specializations of member function templates
Summary: Incorrect parameter passing to specializations of member function templates
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.2
: P3 normal
Target Milestone: 3.3.1
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2002-09-10 02:36 UTC by anthwil
Modified: 2003-08-06 17:42 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-04-30 00:00:00


Attachments
testtemp.cpp (209 bytes, application/octet-stream)
2003-05-21 15:16 UTC, anthwil
Details

Note You need to log in before you can comment on or make changes to this bug.
Description anthwil 2002-09-10 02:36:01 UTC
When the attached program is run, the two output lines are different, when they should be the same. e.g.:

lhs=0x22ff6c, rhs=0x22ff68
lhs=0x22ff68, rhs=0x22ff70

This translates into serious bugs, as variables are read incorrectly and random memory is accessed and updated.

Release:
g++ 3.1 (mingw32 and sparc-solaris-2.7) and g++ 3.2 (mingw32)

Environment:
Reading specs from d:/local/mingw/bin/../lib/gcc-lib/mingw32/3.1/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=
mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable
-languages=f77,c++,objc,ada --disable-win32-registry --disable-shared
Thread model: win32
gcc version 3.1

and

Reading specs from d:/local/mingw/bin/../lib/gcc-lib/i686-pc-mingw32/3.2/specs
Configured with: ../gcc-3.2-20020817-1/configure --enable-languages=c,c++ --pref
ix=d:/local/mingw --enable-threads
Thread model: win32
gcc version 3.2 (mingw special 20020817-1)

and 

Reading specs from /usr/local/lib/gcc-lib/sparc-sun-solaris2.7/3.1/specs
Configured with: ../configure --with-as=/usr/ccs/bin/as --with-ld=/usr/ccs/bin/ld --disable-nls
Thread model: posix
gcc version 3.1

How-To-Repeat:
Compile and run the attached program
Comment 1 Nathan Sidwell 2002-09-13 07:59:40 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: confirmed - the non-templated version behaves as expected
Comment 2 Volker Reichelt 2003-06-04 08:56:31 UTC
Fixed on 3.3 branch and mainline by Kriang's patch for PR 10940:

http://gcc.gnu.org/ml/gcc-cvs/2003-06/msg00095.html