c++/3021: Missing attachment from report c++/3020

mps@sonartech.com.au mps@sonartech.com.au
Thu May 31 21:56:00 GMT 2001


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



More information about the Gcc-bugs mailing list