This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/4408: apparent namespace collision with global variable 'count'



>Number:         4408
>Category:       c++
>Synopsis:       apparent namespace collision with global variable 'count'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 27 03:06:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Bruce Eckel
>Release:        g++ 3.0.1
>Organization:
>Environment:
Cygwin under Win2000
>Description:
NewHandler.cpp: In function `void out_of_memory()':
NewHandler.cpp:16: use of `count' is ambiguous
NewHandler.cpp:12:   first declared as `int count' here
/usr/local/include/g++-v3/bits/stl_algo.h:320:   also declared as `typename 
   std::iterator_traits<_Iterator>::difference_type std::count(_InputIter, 
   _InputIter, const _Tp&)' here
NewHandler.cpp: In function `int main()':
NewHandler.cpp:23: use of `count' is ambiguous
NewHandler.cpp:12:   first declared as `int count' here
/usr/local/include/g++-v3/bits/stl_algo.h:320:   also declared as `typename 
   std::iterator_traits<_Iterator>::difference_type std::count(_InputIter, 
   _InputIter, const _Tp&)' here
>How-To-Repeat:
Compile attached file
>Fix:
remove "using namespace std" and use explicit std::
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="NewHandler.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="NewHandler.cpp"

Ly86IEMxMzpOZXdIYW5kbGVyLmNwcA0KLy8gRnJvbSBUaGlua2luZyBpbiBDKyssIDJuZCBFZGl0
aW9uDQovLyBBdmFpbGFibGUgYXQgaHR0cDovL3d3dy5CcnVjZUVja2VsLmNvbQ0KLy8gKGMpIEJy
dWNlIEVja2VsIDIwMDANCi8vIENvcHlyaWdodCBub3RpY2UgaW4gQ29weXJpZ2h0LnR4dA0KLy8g
Q2hhbmdpbmcgdGhlIG5ldy1oYW5kbGVyDQojaW5jbHVkZSA8aW9zdHJlYW0+DQojaW5jbHVkZSA8
Y3N0ZGxpYj4NCiNpbmNsdWRlIDxuZXc+DQp1c2luZyBuYW1lc3BhY2Ugc3RkOw0KDQppbnQgY291
bnQgPSAwOw0KDQp2b2lkIG91dF9vZl9tZW1vcnkoKSB7DQogIGNlcnIgPDwgIm1lbW9yeSBleGhh
dXN0ZWQgYWZ0ZXIgIiA8PCBjb3VudCANCiAgICA8PCAiIGFsbG9jYXRpb25zISIgPDwgZW5kbDsN
CiAgZXhpdCgxKTsNCn0NCg0KaW50IG1haW4oKSB7DQogIHNldF9uZXdfaGFuZGxlcihvdXRfb2Zf
bWVtb3J5KTsNCiAgd2hpbGUoMSkgew0KICAgIGNvdW50Kys7DQogICAgbmV3IGludFsxMDAwXTsg
Ly8gRXhoYXVzdHMgbWVtb3J5DQogIH0NCn0gLy8vOn4NCg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]