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++/3021: Missing attachment from report c++/3020



>Number:         3021
>Category:       c++
>Synopsis:       Missing attachment from report c++/3020
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Thu May 31 21:56:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Michael Shepanski
>Release:        gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
Linux/Pentium
>Description:
Oops -- didn't succeed in attaching the program text to
bug report c++/3020.  Here it is.
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="tmp.cpp"
Content-Disposition: inline; filename="tmp.cpp"

#include	<stdio.h>

class A {
public:
	int	x;
};

class B {
public:
	A	*a;
	A	* operator-> () { return a; }
	int f () { return this->operator->()->x; }	// ok
	int g () { return this->x; }				// rejected
};

int
main ()
{
	B	b;
	printf ("%d", b -> x);						// ok
}


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