public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/29224]  New: -Wshadow causing warning in <tr1/functional>
@ 2006-09-25 21:51 hhinnant at apple dot com
  2006-09-25 21:55 ` [Bug libstdc++/29224] " pcarlini at suse dot de
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hhinnant at apple dot com @ 2006-09-25 21:51 UTC (permalink / raw)
  To: gcc-bugs

The following test.cpp:

#include <tr1/functional>

struct A
{
    void foo() {}
};

int main()
{
    std::tr1::mem_fn(&A::foo);
}

compiled with:

g++ -Wshadow test.cpp

causes:

/usr/include/c++/4.0.0/tr1/functional_iterate.h: In constructor
'std::tr1::_Mem_fn<_Res (_Class::*)()>::_Mem_fn(_Res (_Class::*)()) [with _Res
= void, _Class = A]':
/usr/include/c++/4.0.0/tr1/functional:502:   instantiated from
'std::tr1::_Mem_fn<_Res _Class::*> std::tr1::mem_fn(_Tp _Class::*) [with _Tp =
void ()(), _Class = A]'
test.cpp:10:   instantiated from here
/usr/include/c++/4.0.0/tr1/functional_iterate.h:202: warning: declaration of
'__pmf' shadows a member of 'this'

The following patch will silence the warning:

$ svn diff
Index: libstdc++-v3/include/tr1/functional_iterate.h
===================================================================
--- libstdc++-v3/include/tr1/functional_iterate.h       (revision 117204)
+++ libstdc++-v3/include/tr1/functional_iterate.h       (working copy)
@@ -195,7 +195,7 @@
   public:
     typedef _Res result_type;

-    explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+    explicit _Mem_fn(_Functor __pf) : __pmf(__pf) { }

     // Handle objects
     _Res
@@ -249,7 +249,7 @@
   public:
     typedef _Res result_type;

-    explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+    explicit _Mem_fn(_Functor __pf) : __pmf(__pf) { }

     // Handle objects
     _Res
@@ -303,7 +303,7 @@
   public:
     typedef _Res result_type;

-    explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+    explicit _Mem_fn(_Functor __pf) : __pmf(__pf) { }

     // Handle objects
     _Res
@@ -357,7 +357,7 @@
   public:
     typedef _Res result_type;

-    explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
+    explicit _Mem_fn(_Functor __pf) : __pmf(__pf) { }

     // Handle objects
     _Res


-- 
           Summary: -Wshadow causing warning in <tr1/functional>
           Product: gcc
           Version: 4.0.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hhinnant at apple dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29224


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

* [Bug libstdc++/29224] -Wshadow causing warning in <tr1/functional>
  2006-09-25 21:51 [Bug libstdc++/29224] New: -Wshadow causing warning in <tr1/functional> hhinnant at apple dot com
@ 2006-09-25 21:55 ` pcarlini at suse dot de
  2006-09-26  0:59 ` paolo at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pcarlini at suse dot de @ 2006-09-25 21:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pcarlini at suse dot de  2006-09-25 21:55 -------
Thanks Howard.


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-09-25 21:55:42
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29224


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

* [Bug libstdc++/29224] -Wshadow causing warning in <tr1/functional>
  2006-09-25 21:51 [Bug libstdc++/29224] New: -Wshadow causing warning in <tr1/functional> hhinnant at apple dot com
  2006-09-25 21:55 ` [Bug libstdc++/29224] " pcarlini at suse dot de
@ 2006-09-26  0:59 ` paolo at gcc dot gnu dot org
  2006-09-26  1:00 ` paolo at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu dot org @ 2006-09-26  0:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from paolo at gcc dot gnu dot org  2006-09-26 00:59 -------
Subject: Bug 29224

Author: paolo
Date: Tue Sep 26 00:59:37 2006
New Revision: 117222

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117222
Log:
2006-09-26  Howard Hinnant  <hhinnant@apple.com>

        PR libstdc++/29224
        * include/tr1/functional_iterate.h: Avoid -Wshadow warnings.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/tr1/functional_iterate.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29224


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

* [Bug libstdc++/29224] -Wshadow causing warning in <tr1/functional>
  2006-09-25 21:51 [Bug libstdc++/29224] New: -Wshadow causing warning in <tr1/functional> hhinnant at apple dot com
  2006-09-25 21:55 ` [Bug libstdc++/29224] " pcarlini at suse dot de
  2006-09-26  0:59 ` paolo at gcc dot gnu dot org
@ 2006-09-26  1:00 ` paolo at gcc dot gnu dot org
  2006-09-26  1:01 ` pcarlini at suse dot de
  2006-10-26  9:30 ` bernie at develer dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu dot org @ 2006-09-26  1:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paolo at gcc dot gnu dot org  2006-09-26 01:00 -------
Subject: Bug 29224

Author: paolo
Date: Tue Sep 26 00:59:53 2006
New Revision: 117223

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=117223
Log:
2006-09-26  Howard Hinnant  <hhinnant@apple.com>

        PR libstdc++/29224
        * include/tr1/functional_iterate.h: Avoid -Wshadow warnings.

Modified:
    branches/gcc-4_1-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_1-branch/libstdc++-v3/include/tr1/functional_iterate.h


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29224


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

* [Bug libstdc++/29224] -Wshadow causing warning in <tr1/functional>
  2006-09-25 21:51 [Bug libstdc++/29224] New: -Wshadow causing warning in <tr1/functional> hhinnant at apple dot com
                   ` (2 preceding siblings ...)
  2006-09-26  1:00 ` paolo at gcc dot gnu dot org
@ 2006-09-26  1:01 ` pcarlini at suse dot de
  2006-10-26  9:30 ` bernie at develer dot com
  4 siblings, 0 replies; 6+ messages in thread
From: pcarlini at suse dot de @ 2006-09-26  1:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pcarlini at suse dot de  2006-09-26 01:01 -------
Fixed for 4.1.2.


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.1.2


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29224


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

* [Bug libstdc++/29224] -Wshadow causing warning in <tr1/functional>
  2006-09-25 21:51 [Bug libstdc++/29224] New: -Wshadow causing warning in <tr1/functional> hhinnant at apple dot com
                   ` (3 preceding siblings ...)
  2006-09-26  1:01 ` pcarlini at suse dot de
@ 2006-10-26  9:30 ` bernie at develer dot com
  4 siblings, 0 replies; 6+ messages in thread
From: bernie at develer dot com @ 2006-10-26  9:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from bernie at develer dot com  2006-10-26 09:30 -------
*** Bug 29603 has been marked as a duplicate of this bug. ***


-- 

bernie at develer dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bernie at develer dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29224


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

end of thread, other threads:[~2006-10-26  9:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-09-25 21:51 [Bug libstdc++/29224] New: -Wshadow causing warning in <tr1/functional> hhinnant at apple dot com
2006-09-25 21:55 ` [Bug libstdc++/29224] " pcarlini at suse dot de
2006-09-26  0:59 ` paolo at gcc dot gnu dot org
2006-09-26  1:00 ` paolo at gcc dot gnu dot org
2006-09-26  1:01 ` pcarlini at suse dot de
2006-10-26  9:30 ` bernie at develer dot com

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