public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-08 22:26 Robert Schwartz
  0 siblings, 0 replies; 12+ messages in thread
From: Robert Schwartz @ 2003-05-08 22:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10649; it has been noted by GNATS.

From: Robert Schwartz <robertallanschwartz@yahoo.com>
To: Gabriel Dos Reis <gdr@integrable-solutions.net>
Cc: giovannibajo@libero.it, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
Date: Thu, 8 May 2003 15:20:41 -0700 (PDT)

 --- Gabriel Dos Reis <gdr@integrable-solutions.net> wrote:
 > Robert Schwartz <robertallanschwartz@yahoo.com> writes:
 > 
 > | --- giovannibajo@libero.it wrote:
 > | > Synopsis: is_pointer<T> reports pointer to member function is not a pointer
 > | > 
 > | > State-Changed-From-To: open->closed
 > | > State-Changed-By: bajo
 > | > State-Changed-When: Wed May  7 00:40:10 2003
 > | > State-Changed-Why:
 > | >     No, a member function pointer cannot match "T*". What would
 > | >     be T, in fact?
 > | 
 > | is_pointer<int foo::*>::value (i.e. pointer to member variable) evaluates to true.
 > | If I remove the * from "int foo::*", then I get "int foo::".
 > | I know this isn't a valid C++ type, but a pointer to a member
 > | variable is still a pointer, no? 
 > 
 > In which sense?  A pointer to member is a different kind of beast.  It
 > is much more close to a struct than to a usual pointer.
 > 
 > -- Gaby
 
 I'm not saying anything about how pointer-to-member is *implemented*; I'm
 saying something about its syntax and its semantics. A pointer to a member
 is a pointer. That's all I'm saying.
 
 Robert
 
 __________________________________
 Do you Yahoo!?
 The New Yahoo! Search - Faster. Easier. Bingo.
 http://search.yahoo.com


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

* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-09  7:06 Gabriel Dos Reis
  0 siblings, 0 replies; 12+ messages in thread
From: Gabriel Dos Reis @ 2003-05-09  7:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10649; it has been noted by GNATS.

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: notbob@tessellation.com
Cc: giovannibajo@libero.it, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
Date: 09 May 2003 09:02:22 +0200

 Robert Schwartz <robertallanschwartz@yahoo.com> writes:
 
 | I'm not saying anything about how pointer-to-member is *implemented*; I'm
 | saying something about its syntax and its semantics. A pointer to a member
 | is a pointer. That's all I'm saying.
 
 No, a pointer-to-member is not a pointer.  Period.
 
 -- Gaby


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

* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-08 22:36 Phil Edwards
  0 siblings, 0 replies; 12+ messages in thread
From: Phil Edwards @ 2003-05-08 22:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10649; it has been noted by GNATS.

From: Phil Edwards <phil@jaj.com>
To: Giovanni Bajo <giovannibajo@libero.it>
Cc: notbob@tessellation.com, gcc-bugs@gcc.gnu.org,
	gcc-gnats@gcc.gnu.org
Subject: Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
Date: Thu, 8 May 2003 18:34:39 -0400

 On Thu, May 08, 2003 at 02:11:05AM +0200, Giovanni Bajo wrote:
 > Phil Edwards <phil@jaj.com> wrote:
 > 
 > > Also, the cxx-reflection-branch will, eventually, implement these
 > templates
 > > (taken from the ISO proposal).  I have a patch which does, but the new
 > > parser won't let me do pointers-to-members like I'd planned.
 > 
 > What is the problem with pointers-to-members, exactly? I assume there is
 > already an open PR for it, otherwise you should file one.
 
 I'm assuming the problem is in my code, since p-t-m's are successfully used
 by others.
 
 -- 
 If ye love wealth greater than liberty, the tranquility of servitude greater
 than the animating contest for freedom, go home and leave us in peace.  We seek
 not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
 and may posterity forget that ye were our countrymen.            - Samuel Adams


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

* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-08 22:36 Giovanni Bajo
  0 siblings, 0 replies; 12+ messages in thread
From: Giovanni Bajo @ 2003-05-08 22:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10649; it has been noted by GNATS.

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <notbob@tessellation.com>,
	"Gabriel Dos Reis" <gdr@integrable-solutions.net>
Cc: <gcc-bugs@gcc.gnu.org>,
	<gcc-gnats@gcc.gnu.org>
Subject: Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
Date: Fri, 9 May 2003 00:27:22 +0200

 Robert Schwartz <robertallanschwartz@yahoo.com> wrote:
 
 > I'm not saying anything about how pointer-to-member is *implemented*; I'm
 > saying something about its syntax and its semantics. A pointer to a member
 > is a pointer. That's all I'm saying.
 
 I'm lost here. Are you arguing that your code should work, or is it just
 some theorical conversation about the meaning of the word "pointer"?
 I think we agree that your code should not work and the PR is rightfully
 closed.
 
 If it's not about the PR, please leave gcc-gnats@ outside the CC, thanks.
 
 Giovanni Bajo
 


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

* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-08 14:16 Gabriel Dos Reis
  0 siblings, 0 replies; 12+ messages in thread
From: Gabriel Dos Reis @ 2003-05-08 14:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10649; it has been noted by GNATS.

From: Gabriel Dos Reis <gdr@integrable-solutions.net>
To: notbob@tessellation.com
Cc: giovannibajo@libero.it, gcc-bugs@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Subject: Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
Date: 08 May 2003 16:11:57 +0200

 Robert Schwartz <robertallanschwartz@yahoo.com> writes:
 
 | --- giovannibajo@libero.it wrote:
 | > Synopsis: is_pointer<T> reports pointer to member function is not a pointer
 | > 
 | > State-Changed-From-To: open->closed
 | > State-Changed-By: bajo
 | > State-Changed-When: Wed May  7 00:40:10 2003
 | > State-Changed-Why:
 | >     No, a member function pointer cannot match "T*". What would
 | >     be T, in fact?
 | 
 | is_pointer<int foo::*>::value (i.e. pointer to member variable) evaluates to true.
 | If I remove the * from "int foo::*", then I get "int foo::".
 | I know this isn't a valid C++ type, but a pointer to a member
 | variable is still a pointer, no? 
 
 In which sense?  A pointer to member is a different kind of beast.  It
 is much more close to a struct than to a usual pointer.
 
 -- Gaby


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

* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-08  0:26 Giovanni Bajo
  0 siblings, 0 replies; 12+ messages in thread
From: Giovanni Bajo @ 2003-05-08  0:26 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10649; it has been noted by GNATS.

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <notbob@tessellation.com>
Cc: <gcc-gnats@gcc.gnu.org>,
	<gcc-bugs@gcc.gnu.org>
Subject: Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
Date: Thu, 8 May 2003 02:17:26 +0200

 Robert Schwartz <robertallanschwartz@yahoo.com> wrote:
 
 
 >>> is_pointer<int foo::*>::value (i.e. pointer to member variable)
 evaluates
 >>> to true.
 
 >>[bla bla bla]
 
 > I appreciate what you are saying. I'm still confused about why the
 template
 > says a pointer to a member variable IS a pointer, but a pointer to a
 member
 > function IS NOT a pointer. This seems inconsistent to me.
 
 Sorry, I had missed that very sentence.
 
 It's a bug in the (now discontinued) 3.2 branch, and it's fixed in 3.3 and
 3.4 (CVS 20030503). If you run your template there, you will see that both
 pointer to member functions and pointer to member variables evalutate to
 *false*, which is the expected consistent behaviour.
 
 Giovanni Bajo
 


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

* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-08  0:16 Giovanni Bajo
  0 siblings, 0 replies; 12+ messages in thread
From: Giovanni Bajo @ 2003-05-08  0:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10649; it has been noted by GNATS.

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: "Phil Edwards" <phil@jaj.com>
Cc: <notbob@tessellation.com>,
	<gcc-bugs@gcc.gnu.org>,
	<gcc-gnats@gcc.gnu.org>
Subject: Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
Date: Thu, 8 May 2003 02:11:05 +0200

 Phil Edwards <phil@jaj.com> wrote:
 
 > Also, the cxx-reflection-branch will, eventually, implement these
 templates
 > (taken from the ISO proposal).  I have a patch which does, but the new
 > parser won't let me do pointers-to-members like I'd planned.
 
 What is the problem with pointers-to-members, exactly? I assume there is
 already an open PR for it, otherwise you should file one.
 
 Giovanni Bajo
 


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

* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-07 23:56 Phil Edwards
  0 siblings, 0 replies; 12+ messages in thread
From: Phil Edwards @ 2003-05-07 23:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10649; it has been noted by GNATS.

From: Phil Edwards <phil@jaj.com>
To: Giovanni Bajo <giovannibajo@libero.it>
Cc: notbob@tessellation.com, gcc-bugs@gcc.gnu.org,
	gcc-gnats@gcc.gnu.org
Subject: Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
Date: Wed, 7 May 2003 19:55:33 -0400

 On Thu, May 08, 2003 at 01:34:52AM +0200, Giovanni Bajo wrote:
 > Robert Schwartz <robertallanschwartz@yahoo.com> wrote:
 > 
 > > If I remove the * from "int (foo::*)(void)", then I get "int
 > (foo::)(void)".
 > > I know this isn't a valid C++ type, but a pointer to a member function is
 > > still a pointer, no?
 [...]
 > You can check the Type Trait library within Boost, they
 > have metafunctions to check for every thing you can think of about types,
 > and they work on every compiler out there (most of them can work even
 > without partial specialization). It will give you an idea about how to
 > implement such constructs.
 
 Also, the cxx-reflection-branch will, eventually, implement these templates
 (taken from the ISO proposal).  I have a patch which does, but the new parser
 won't let me do pointers-to-members like I'd planned.
 
 
 Phil
 
 -- 
 If ye love wealth greater than liberty, the tranquility of servitude greater
 than the animating contest for freedom, go home and leave us in peace.  We seek
 not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
 and may posterity forget that ye were our countrymen.            - Samuel Adams


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

* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-07 23:36 Giovanni Bajo
  0 siblings, 0 replies; 12+ messages in thread
From: Giovanni Bajo @ 2003-05-07 23:36 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10649; it has been noted by GNATS.

From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <notbob@tessellation.com>,
	<gcc-bugs@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	<gcc-gnats@gcc.gnu.org>
Cc:  
Subject: Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
Date: Thu, 8 May 2003 01:34:52 +0200

 Robert Schwartz <robertallanschwartz@yahoo.com> wrote:
 
 > is_pointer<int foo::*>::value (i.e. pointer to member variable) evaluates
 > to true.
 > If I remove the * from "int foo::*", then I get "int foo::".
 > I know this isn't a valid C++ type, but a pointer to a member variable is
 > still a pointer, no?
 >
 > If I remove the * from "int (foo::*)(void)", then I get "int
 (foo::)(void)".
 > I know this isn't a valid C++ type, but a pointer to a member function is
 > still a pointer, no?
 
 
 I'm not arguing about what is a pointer and what is not. I'm saying that a
 compiler can't instantiate your template with "T = int foo::" because "int
 foo::" is not a type, like you are stating yourself. This does not mean that
 a pointer to a member function or a member variable is not a pointer. It
 simply means that your way to detect what is a pointer and what is not a
 pointer is wrong. You can check the Type Trait library within Boost, they
 have metafunctions to check for every thing you can think of about types,
 and they work on every compiler out there (most of them can work even
 without partial specialization). It will give you an idea about how to
 implement such constructs.
 
 Giovanni Bajo
 


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

* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-07 23:16 Robert Schwartz
  0 siblings, 0 replies; 12+ messages in thread
From: Robert Schwartz @ 2003-05-07 23:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR c++/10649; it has been noted by GNATS.

From: Robert Schwartz <robertallanschwartz@yahoo.com>
To: giovannibajo@libero.it, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org,
  nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
Date: Wed, 7 May 2003 16:07:39 -0700 (PDT)

 --- giovannibajo@libero.it wrote:
 > Synopsis: is_pointer<T> reports pointer to member function is not a pointer
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: bajo
 > State-Changed-When: Wed May  7 00:40:10 2003
 > State-Changed-Why:
 >     No, a member function pointer cannot match "T*". What would
 >     be T, in fact?
 
 is_pointer<int foo::*>::value (i.e. pointer to member variable) evaluates to true.
 If I remove the * from "int foo::*", then I get "int foo::".
 I know this isn't a valid C++ type, but a pointer to a member variable is still a pointer, no?
 
 If I remove the * from "int (foo::*)(void)", then I get "int (foo::)(void)".
 I know this isn't a valid C++ type, but a pointer to a member function is still a pointer, no?
 
 > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10649
 
 
 __________________________________
 Do you Yahoo!?
 The New Yahoo! Search - Faster. Easier. Bingo.
 http://search.yahoo.com


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

* Re: c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-07  0:40 giovannibajo
  0 siblings, 0 replies; 12+ messages in thread
From: giovannibajo @ 2003-05-07  0:40 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, notbob

Synopsis: is_pointer<T> reports pointer to member function is not a pointer

State-Changed-From-To: open->closed
State-Changed-By: bajo
State-Changed-When: Wed May  7 00:40:10 2003
State-Changed-Why:
    No, a member function pointer cannot match "T*". What would
    be T, in fact?

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


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

* c++/10649: is_pointer<T> reports pointer to member function is not a pointer
@ 2003-05-06 22:56 notbob
  0 siblings, 0 replies; 12+ messages in thread
From: notbob @ 2003-05-06 22:56 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10649
>Category:       c++
>Synopsis:       is_pointer<T> reports pointer to member function is not a pointer
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue May 06 22:56:02 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Robert Allan Schwartz
>Release:        gcc version 3.2 20020927 (prerelease)
>Organization:
>Environment:
in bash via cygwin on windows 98 se
>Description:
I apologize in advance if I'm not reporting this "bug"
absolutely correctly. I haven't done this before. I
appreciate your patience. Thank you.

I believe my template should report void (i_am_a_class::*)(void) is a pointer, but instead it returns false.

Is this "pilot error" or a compiler bug?
>How-To-Repeat:
g++ is_pointer.cpp
./a.exe
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="is_pointer.cpp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="is_pointer.cpp"

dGVtcGxhdGUgPHR5cGVuYW1lIFQ+DQpjbGFzcyBpc19wb2ludGVyIHsgcHVibGljOiBzdGF0aWMg
Y29uc3QgYm9vbCB2YWx1ZSA9IGZhbHNlOyB9Ow0KDQp0ZW1wbGF0ZSA8dHlwZW5hbWUgVD4NCmNs
YXNzIGlzX3BvaW50ZXI8VCAqPiB7IHB1YmxpYzogc3RhdGljIGNvbnN0IGJvb2wgdmFsdWUgPSB0
cnVlOyB9Ow0KDQojaW5jbHVkZSA8aW9zdHJlYW0+DQoNCmNsYXNzIGlfYW1fYV9jbGFzcyB7IH07
DQoNCmludCBtYWluKCkNCnsNCglzdGQ6OmNvdXQgPDwgImlzX3BvaW50ZXI8dm9pZCAoaV9hbV9h
X2NsYXNzOjoqKSh2b2lkKT46OnZhbHVlID0gIiA8PCBpc19wb2ludGVyPHZvaWQgKGlfYW1fYV9j
bGFzczo6Kikodm9pZCk+Ojp2YWx1ZSA8PCBzdGQ6OmVuZGw7DQoNCglyZXR1cm4gMDsNCn0NCg==


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

end of thread, other threads:[~2003-05-09  7:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-08 22:26 c++/10649: is_pointer<T> reports pointer to member function is not a pointer Robert Schwartz
  -- strict thread matches above, loose matches on Subject: below --
2003-05-09  7:06 Gabriel Dos Reis
2003-05-08 22:36 Giovanni Bajo
2003-05-08 22:36 Phil Edwards
2003-05-08 14:16 Gabriel Dos Reis
2003-05-08  0:26 Giovanni Bajo
2003-05-08  0:16 Giovanni Bajo
2003-05-07 23:56 Phil Edwards
2003-05-07 23:36 Giovanni Bajo
2003-05-07 23:16 Robert Schwartz
2003-05-07  0:40 giovannibajo
2003-05-06 22:56 notbob

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