summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.benjamin/18208.C
blob: 2e9b7ce7ab69d9ad88956070ca2d684e0afd72fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// { dg-do assemble  }
// 981204 bkoz
// g++/18208

typedef unsigned int uint_32;

class puertorico {
public:
  void *f ();
private:
  uint_32 member;
};

void foo( )
{
  uint_32 ui;
  puertorico obj;

  // Bug using static_cast<>
  ui = static_cast<uint_32>(obj); // { dg-error "" } // ERROR -
  
  // Bug when missing the pair of braces
  ui = (uint_32) obj.f; // { dg-error "" } // ERROR -
}