public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4408: apparent namespace collision with global variable 'count'
@ 2002-11-29 19:16 bangerth
  0 siblings, 0 replies; 3+ messages in thread
From: bangerth @ 2002-11-29 19:16 UTC (permalink / raw)
  To: Bruce, gcc-bugs, gcc-prs, nobody

Synopsis: apparent namespace collision with global variable 'count'

State-Changed-From-To: feedback->closed
State-Changed-By: bangerth
State-Changed-When: Wed Nov 20 18:59:49 2002
State-Changed-Why:
    User error and no feedback in a long time.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4408


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

* Re: c++/4408: apparent namespace collision with global variable 'count'
@ 2002-04-19 13:29 pme
  0 siblings, 0 replies; 3+ messages in thread
From: pme @ 2002-04-19 13:29 UTC (permalink / raw)
  To: Bruce, gcc-bugs, gcc-prs, nobody

Synopsis: apparent namespace collision with global variable 'count'

State-Changed-From-To: open->feedback
State-Changed-By: pme
State-Changed-When: Fri Apr 19 13:29:50 2002
State-Changed-Why:
    Perhaps I'm missing something, but I'm not certain what you
    think the bug is here.  You cannot declare names already
    used in the library and expect the compiler to distinguish
    between them, once you pull all the library names into the
    same namespace as your own variable.
    
    The fix you list would therefore seem to be the only
    correct way to write the code, if you must use names that
    could collide with the standard library (count, cerr, cos,
    and so forth).

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=4408


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

* c++/4408: apparent namespace collision with global variable 'count'
@ 2001-09-27  3:06 Bruce
  0 siblings, 0 replies; 3+ messages in thread
From: Bruce @ 2001-09-27  3:06 UTC (permalink / raw)
  To: gcc-gnats

>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==


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

end of thread, other threads:[~2002-11-21  2:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-29 19:16 c++/4408: apparent namespace collision with global variable 'count' bangerth
  -- strict thread matches above, loose matches on Subject: below --
2002-04-19 13:29 pme
2001-09-27  3:06 Bruce

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).