OpenCores
URL https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [tree-ssa/] [pr22550.C] - Rev 478

Go to most recent revision | Compare with Previous | Blame | View Log

/* { dg-do compile } */
/* { dg-options "-O2" } */

class X {
public:
  int mfunc1 () {
    return 1;
  }
  int mfunc2 () {
    return 2;
  }
  X (int a, int b) { }
};

typedef int (X::*memfunc_p_t) ();

memfunc_p_t mf_arr[2] = { &X::mfunc1, &X::mfunc2 };

int
main ()
{
  // Get pntr to the array of pointers to member-funcs
  memfunc_p_t (*mf_arr_p)[2] = &mf_arr;
  // Compare indirect against direct access to an array element
  if ((*mf_arr_p)[0] != mf_arr[0])
    return 1;
  return 0;
}

Go to most recent revision | 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.