| 1 |
// { dg-do run } |
| 2 |
// GROUPS passed temps |
| 3 |
// Date: Tue, 22 Mar 94 12:46:28 +0100 |
| 4 |
// From: [email protected] |
| 5 |
// Message-Id: <9403221146.AA07815@messua> |
| 6 |
// Subject: Bad code for pointer to member use as reference in g++ 2.5.8 |
| 7 |
|
| 8 |
#include <stdio.h> |
| 9 |
struct str { |
| 10 |
int i; |
| 11 |
} xxx = {0}; |
| 12 |
|
| 13 |
int& test(str *arg1, int str::*arg2) |
| 14 |
{ |
| 15 |
return (arg1->*arg2); |
| 16 |
} |
| 17 |
|
| 18 |
int main() |
| 19 |
{ |
| 20 |
test(&xxx, &str::i) = 5; |
| 21 |
if (xxx.i == 0) |
| 22 |
{ printf ("FAIL\n"); return 1; } |
| 23 |
else |
| 24 |
printf ("PASS\n"); |
| 25 |
} |