diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/friend.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.jason/friend.C | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/friend.C b/gcc/testsuite/g++.old-deja/g++.jason/friend.C new file mode 100644 index 00000000000..ee6ee8d5eae --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.jason/friend.C @@ -0,0 +1,18 @@ +// Bug: g++ doesn't keep track of the lexical context of friends properly. + +extern "C" void exit(int); + +struct B; +struct A { + static void f () { exit (1); } +}; + +struct B { + static void f () { exit (0); } + friend void g () { f (); } +}; + +main () +{ + g (); +} |