| 1 |
// { dg-do assemble } |
| 2 |
// { dg-skip-if "requires hosted libstdc++ for iostream" { ! hostedlib } } |
| 3 |
// Error: Internal Compiler Error in GCC 2.7.2 and EGCS 1998/05/28 snapshot. |
| 4 |
|
| 5 |
#include <iostream> |
| 6 |
|
| 7 |
class some_base |
| 8 |
{ |
| 9 |
public: |
| 10 |
class base_func_args; |
| 11 |
virtual void func(base_func_args &) = 0; // { dg-message "note" } referenced below |
| 12 |
}; |
| 13 |
|
| 14 |
class some_base::base_func_args |
| 15 |
{ |
| 16 |
public: |
| 17 |
int i; |
| 18 |
}; |
| 19 |
|
| 20 |
class some_derived : public some_base // { dg-message "note" } |
| 21 |
{ |
| 22 |
public: |
| 23 |
class derived_func_args; |
| 24 |
void func(derived_func_args &); |
| 25 |
}; |
| 26 |
|
| 27 |
|
| 28 |
class derived_func_args : public some_base::base_func_args |
| 29 |
{ |
| 30 |
public: |
| 31 |
float f; |
| 32 |
}; |
| 33 |
|
| 34 |
class some_derived::func(derived_func_args &a) // { dg-error "does not name a type" "type" } illegal member syntax |
| 35 |
// { dg-error "expected" "exp" { target *-*-* } .-1 } |
| 36 |
{ |
| 37 |
std::cout << a.i << ' ' << a.f << std::endl; |
| 38 |
} |
| 39 |
|
| 40 |
int |
| 41 |
main() |
| 42 |
{ |
| 43 |
some_derived d; // { dg-error "abstract type" } |
| 44 |
some_derived::derived_func_args dfa; // { dg-error "incomplete type" } |
| 45 |
some_base *b = &d; |
| 46 |
|
| 47 |
dfa.i = 10; |
| 48 |
dfa.f = 20; |
| 49 |
b->func(dfs); // { dg-error "'dfs' was not declared" } |
| 50 |
return 0; |
| 51 |
} |