view gcc/testsuite/g++.old-deja/g++.mike/p786.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do run  }
// prms-id: 786

extern "C" int printf (const char *, ...);
extern "C" void exit(int);
class C
   {
   int a;
public:
   C() {a = 1;}
   };

void func(const C& a, C& b)
{
   printf ("in const func\n");
   exit(1);
}

void func(C& a, C& b)
{
   printf ("in non-const func\n");
}

void testit(const C& a, C& b)
{
   func(a,b);
}

int main()
{
   C a;
   C b;

   func(a,b);
   return 0;
}