summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/lookup/exception1.C
blob: b5fcd0a6c4d2ee1323678ff540d695ce0c07a12f (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
31
32
33
/* PR 2743 */
/* { dg-do compile } */

namespace ns {
  class Exception
  {
  };
}

namespace ns
{
  class Test {
    public:
      inline Test() throw( Exception );
      inline Test(int n ) throw( Exception );
    private:
      int i;
  };
}

// This line used to fail because Exception wasn't looked up in the
// right scope.
ns::Test::Test() throw( Exception ) : i( 1 )
{
}

ns::Test::Test( int n ) throw( Exception ) : i( n )
{
}

int main(int argc, char* argv[]) {
  ns::Test test;
}