| 1 |
// { dg-do assemble } |
| 2 |
// { dg-options "-O" } |
| 3 |
// Bug: Synthesizing methods for the nested class screwed up current_class_decl |
| 4 |
// for the outer class. |
| 5 |
|
| 6 |
class A; |
| 7 |
class AH |
| 8 |
{ |
| 9 |
public: |
| 10 |
AH ( A * p = 0 ); |
| 11 |
AH ( const AH & from ) |
| 12 |
: pointer( from.pointer ) { inc(); } |
| 13 |
~ AH () { dec(); } |
| 14 |
private: |
| 15 |
A * pointer; |
| 16 |
void inc() const; |
| 17 |
void dec() const; |
| 18 |
}; |
| 19 |
|
| 20 |
class A |
| 21 |
{ |
| 22 |
protected: |
| 23 |
struct AttrTable |
| 24 |
{ |
| 25 |
struct Row |
| 26 |
{ |
| 27 |
}; |
| 28 |
}; |
| 29 |
|
| 30 |
public: |
| 31 |
|
| 32 |
class Attributes |
| 33 |
{ |
| 34 |
public: |
| 35 |
class iterator |
| 36 |
{ |
| 37 |
public: |
| 38 |
iterator() : mo(0), attr(0) {} |
| 39 |
iterator& operator++() { ++attr; return *this; } |
| 40 |
iterator operator++(int) |
| 41 |
{ iterator tmp = *this; ++*this; return tmp; } |
| 42 |
|
| 43 |
private: |
| 44 |
AH mo; |
| 45 |
const AttrTable::Row* attr; |
| 46 |
}; |
| 47 |
|
| 48 |
Attributes(AH mo) |
| 49 |
: mo(mo) {} |
| 50 |
AH mo; |
| 51 |
}; |
| 52 |
}; |