summaryrefslogtreecommitdiff
path: root/Examples/test-suite/d/default_constructor_runme.1.d
blob: 3640218aeaf531bb7626eeb99125cea074619275 (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
30
module default_constructor_runme;

import default_constructor.FFF;
import default_constructor.G;

void main() {
  // Protected destructor test.
  try {
    {
      scope g = new G();
    }
    throw new Exception("Protected destructor exception should have been thrown");
  } catch (Exception e) {
    if (e.msg != "C++ destructor does not have public access") {
      throw e;
    }
  }

  // Private destructor test.
  try {
    {
      scope f = new FFF();
    }
    throw new Exception("Private destructor exception should have been thrown");
  } catch (Exception e) {
    if (e.msg != "C++ destructor does not have public access") {
      throw e;
    }
  }
}