public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/4379: Member pointer to member reference not allowed when declared directly, but allowed as template parameter.
@ 2002-01-02  3:39 nathan
  0 siblings, 0 replies; 4+ messages in thread
From: nathan @ 2002-01-02  3:39 UTC (permalink / raw)
  To: carlo, gcc-bugs, gcc-prs, nathan

Synopsis: Member pointer to member reference not allowed when declared directly, but allowed as template parameter.

State-Changed-From-To: analyzed->closed
State-Changed-By: nathan
State-Changed-When: Wed Jan  2 03:39:37 2002
State-Changed-Why:
    2002-01-02  Nathan Sidwell  <nathan@codesourcery.com>
    
    	PR c++/4379
    	* typeck.c (build_x_unary_op): Don't destroy the OFFSET_REF on a
    	single non-static member.
    	(unary_complex_lvalue): If it cannot be a pointer to member, don't
    	make it so. Check it is not pointer to reference.
    

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


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

* Re: c++/4379: Member pointer to member reference not allowed when declared directly, but allowed as template parameter.
@ 2001-12-15 12:03 nathan
  0 siblings, 0 replies; 4+ messages in thread
From: nathan @ 2001-12-15 12:03 UTC (permalink / raw)
  To: carlo, gcc-bugs, gcc-prs, nathan, nobody

Synopsis: Member pointer to member reference not allowed when declared directly, but allowed as template parameter.

Responsible-Changed-From-To: unassigned->nathan
Responsible-Changed-By: nathan
Responsible-Changed-When: Sat Dec 15 12:03:26 2001
Responsible-Changed-Why:
    in progress
State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Sat Dec 15 12:03:26 2001
State-Changed-Why:
    There are no pointers to reference. The template should
    be rejected

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


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

* Re: c++/4379: Member pointer to member reference not allowed when declared directly, but allowed as template parameter.
@ 2001-09-23 19:56 Carlo Wood
  0 siblings, 0 replies; 4+ messages in thread
From: Carlo Wood @ 2001-09-23 19:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

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

From: Carlo Wood <carlo@alinoe.com>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: c++/4379: Member pointer to member reference not allowed when declared directly, but allowed as template parameter.
Date: Mon, 24 Sep 2001 04:55:06 +0200

 >                                         // This allows to do:  D y; and use y.*x as a reference to y.d.
 
 Make that "This allows to do:  D y; and use y.*x, being the reference y.d"
 
 -- 
 Carlo Wood <carlo@alinoe.com>


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

* c++/4379: Member pointer to member reference not allowed when declared directly, but allowed as template parameter.
@ 2001-09-23 19:46 carlo
  0 siblings, 0 replies; 4+ messages in thread
From: carlo @ 2001-09-23 19:46 UTC (permalink / raw)
  To: gcc-gnats

>Number:         4379
>Category:       c++
>Synopsis:       Member pointer to member reference not allowed when declared directly, but allowed as template parameter.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 23 19:46:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Carlo Wood
>Release:        3.x
>Organization:
>Environment:
i686-rawhide-gnu-linux
>Description:
g++ 3.x gives an error when declaring a function with
a parameter that is a member pointer to a reference
but allows to pass that as templated parameter at the
same time.

I believe it should be accepted always, but it certainly
is a bug because it is inconsistent.
>How-To-Repeat:
Compile the following code snippet.

// g++-3.1 -c bug.cc
 
typedef int a4_t[4];
typedef a4_t* ap4_t;
struct C {
  ap4_t c;
};
typedef int a3_t[3];
typedef a3_t& ar3_t;
a3_t a3 = { 1, 2, 3 };
struct D {
  D(void) : d(a3) { }
  ar3_t d;
};
 
template<class T4>
void f1(ap4_t (C::*), T4 x) { }         // T4 ends up as `ar3_t (D::*)'.
                                        // This allows to do:  D y; and use y.*x as a reference to y.d.
void test1(void)
{
  f1(&C::c, &D::d);                     // Works fine.
}
 
void f2(ap4_t (C::*), ar3_t (D::*)) { } // Wrong error: "cannot declare pointer to `int (&)[3]' member".
 
void test2(void)
{
  f2(&C::c, &D::d);                     // Doesn't work.
}
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-01-02 11:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-01-02  3:39 c++/4379: Member pointer to member reference not allowed when declared directly, but allowed as template parameter nathan
  -- strict thread matches above, loose matches on Subject: below --
2001-12-15 12:03 nathan
2001-09-23 19:56 Carlo Wood
2001-09-23 19:46 carlo

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