summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/except1.C
blob: edfb85f7ce92fede9432b382524d41ff7ad78c9e (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
26
27
28
29
// Build don't link: 
// Special g++ Options: -fexceptions
// GROUPS passed exceptions
// except file
// Message-Id: <9207221230.AA08566@life.ai.mit.edu>
// From: EWALLACE@endvmtkl.vnet.ibm.com
// Subject: Bugs
// Date: Wed, 22 Jul 92 08:29:30 EDT

extern "C" void puts(const char *);

class foo {
public:
  class error {};

  void cause_error(void) { throw error(); }
};

int main(void)
{
  foo f;
  try {
    f.cause_error();
  }
  catch (foo::error) {
    puts("Caught it.");
  }
  return 0;
}