summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eb4.C
blob: dfd3d6ceda4ebe0e6d5c93d9195d065f8a2631f7 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// { dg-do assemble  }
// Error: Internal Compiler Error in GCC 2.7.2 and EGCS 1998/05/28 snapshot.

#include <iostream>

class some_base
        {
public:
        class base_func_args;
        virtual void func(base_func_args &) = 0; // { dg-message "note" } referenced below
        };

class some_base::base_func_args
        {
public:
        int i;
        };

class some_derived : public some_base // { dg-message "note" }
        {
public:
        class derived_func_args;
        void func(derived_func_args &);
        };


class derived_func_args : public some_base::base_func_args
        {
public:
        float f;
        };

class some_derived::func(derived_func_args &a)  // { dg-error "does not name a type" "type" } illegal member syntax
// { dg-error "expected" "exp" { target *-*-* } 33 }
        {
        std::cout << a.i << ' ' << a.f << std::endl;
        }

int
main()
        {
	some_derived d;                     // { dg-error "abstract type" } 
        some_derived::derived_func_args dfa; // { dg-error "incomplete type" } 
        some_base *b = &d;

        dfa.i = 10;
        dfa.f = 20;
        b->func(dfs);                       // { dg-error "'dfs' was not declared" } 
        return 0;
        }