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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.bugs/] [900215_01.C] - Diff between revs 149 and 154

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

Rev 149 Rev 154
// { dg-do assemble  }
// { dg-do assemble  }
// g++ 1.36.1 bug 900215_01
// g++ 1.36.1 bug 900215_01
// g++ allows the definition of a type conversion operator `operator void'
// g++ allows the definition of a type conversion operator `operator void'
// for class types, but subsequently fails to generate calls (where needed)
// for class types, but subsequently fails to generate calls (where needed)
// for such type conversion operators.
// for such type conversion operators.
// Cfront 2.0 does generate such calls.
// Cfront 2.0 does generate such calls.
// The following program exits with status 0 when compiled with Cfront 2.0
// The following program exits with status 0 when compiled with Cfront 2.0
// but exits with status 1 when compiled with g++.
// but exits with status 1 when compiled with g++.
// Cfront 2.0 passes this test.
// Cfront 2.0 passes this test.
// 4/27/94 (jason): The pre-San Diego working paper prohibits operator
// 4/27/94 (jason): The pre-San Diego working paper prohibits operator
// void, so we can go back to just ignoring void values.
// void, so we can go back to just ignoring void values.
// keywords: user-defined type conversion operators, void type, explicit casts
// keywords: user-defined type conversion operators, void type, explicit casts
// 8/3/2000 (nathan): The std allows you to define such an op, but
// 8/3/2000 (nathan): The std allows you to define such an op, but
// it will never be called. [class.conv.fct]. Make it an unconditional warning.
// it will never be called. [class.conv.fct]. Make it an unconditional warning.
// { dg-options "-Wconversion" }
// { dg-options "-Wconversion" }
struct struct0 {
struct struct0 {
  operator void ();             // { dg-warning "" } operator void
  operator void ();             // { dg-warning "" } operator void
};
};
int exit_status = 1;
int exit_status = 1;
struct0::operator void ()
struct0::operator void ()
{
{
  exit_status = 0;
  exit_status = 0;
}
}
struct struct0 s0_object;
struct struct0 s0_object;
int test ()
int test ()
{
{
  (void) s0_object;
  (void) s0_object;
  return exit_status;
  return exit_status;
}
}
int main () { return test (); }
int main () { return test (); }
 
 

powered by: WebSVN 2.1.0

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