OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.benjamin/] [friend01.C] - Rev 384

Compare with Previous | Blame | View Log

// { dg-do assemble  }
//980610 bkoz
// example 1: buggy

class foo {
public:
    class bar;
    int func(bar *);
    class bar {
        int st;
    public:
        bar(){st=12;}
        ~bar(){}
        friend int foo::func(bar *);
    };
    foo(){}
    ~foo(){}
};


int foo::func(bar *obj) {
  obj->st++;
  return (obj->st);
}

void test02() {
  foo obj_f;
  foo::bar obj_b;
  
  obj_f.func( &obj_b);
}

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.