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.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [temps6.C] - Diff between revs 305 and 338

Only display areas with differences | Details | Blame | View Log

Rev 305 Rev 338
// { dg-do run  }
// { dg-do run  }
// GROUPS passed temps
// GROUPS passed temps
// Date: Tue, 22 Mar 94 12:46:28 +0100
// Date: Tue, 22 Mar 94 12:46:28 +0100
// From: dak@pool.informatik.rwth-aachen.de
// From: dak@pool.informatik.rwth-aachen.de
// Message-Id: <9403221146.AA07815@messua>
// Message-Id: <9403221146.AA07815@messua>
// Subject: Bad code for pointer to member use as reference in g++ 2.5.8
// Subject: Bad code for pointer to member use as reference in g++ 2.5.8
#include 
#include 
struct str {
struct str {
  int i;
  int i;
} xxx = {0};
} xxx = {0};
int& test(str *arg1, int str::*arg2)
int& test(str *arg1, int str::*arg2)
{
{
  return (arg1->*arg2);
  return (arg1->*arg2);
}
}
int main()
int main()
{
{
  test(&xxx, &str::i) = 5;
  test(&xxx, &str::i) = 5;
  if (xxx.i == 0)
  if (xxx.i == 0)
    { printf ("FAIL\n"); return 1; }
    { printf ("FAIL\n"); return 1; }
  else
  else
    printf ("PASS\n");
    printf ("PASS\n");
}
}
 
 

powered by: WebSVN 2.1.0

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