This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/8279: REGRESSION: failure to find a matching function in ostream_iterator expansion
- From: jbuck at synopsys dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 18 Oct 2002 20:47:13 -0000
- Subject: c++/8279: REGRESSION: failure to find a matching function in ostream_iterator expansion
- Reply-to: jbuck at synopsys dot com
>Number: 8279
>Category: c++
>Synopsis: REGRESSION: failure to find a matching function in ostream_iterator expansion
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Oct 18 13:56:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Joe Buck
>Release: gcc-3.2
>Organization:
>Environment:
both linux (red hat 7.2) and solaris (sparc 2.7)
>Description:
The attached program compiles and runs correctly under
gcc 2.95.2, but fails to compile under gcc 3.2 (including
the release branch as of 17 Oct). The compiler complains
that it cannot find a compatible operator<< while expanding
the ostream_iterator template, even though an exact match
is present. Defining HIDE_BUG reveals that the compiler is
perfectly capable of finding the operator<< and using it
when a loop, rather than std::copy to the ostream_iterator,
is used
>How-To-Repeat:
Do
gcc -c map_test.cpp
for comparison, try
gcc -c -DHIDE_BUG map_test.cpp
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="map_test.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="map_test.cpp"
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8YWxnb3JpdGht
PgojaW5jbHVkZSA8aXRlcmF0b3I+CiNpbmNsdWRlIDxtYXA+CiNpbmNsdWRlIDx2ZWN0b3I+Cgp0
eXBlZGVmIHN0ZDo6bWFwPHN0ZDo6c3RyaW5nLHVuc2lnbmVkPiBNYXB0eXBlOwp0eXBlZGVmIHN0
ZDo6cGFpcjxzdGQ6OnN0cmluZyx1bnNpZ25lZD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