| 1 |
// { dg-module-do run } |
| 2 |
// { dg-additional-options "-fmodules-ts" } |
| 3 |
|
| 4 |
// indirect references to import. Non-template cases |
| 5 |
|
| 6 |
export module foo; |
| 7 |
// { dg-module-cmi foo } |
| 8 |
|
| 9 |
namespace foo { |
| 10 |
|
| 11 |
export int frob (int i) |
| 12 |
{ |
| 13 |
return i; |
| 14 |
} |
| 15 |
|
| 16 |
|
| 17 |
export class X |
| 18 |
{ |
| 19 |
int i; |
| 20 |
|
| 21 |
public: |
| 22 |
X (int i) :i(i) { } |
| 23 |
operator int () const { return i; } |
| 24 |
}; |
| 25 |
|
| 26 |
export class Y : public virtual X |
| 27 |
{ |
| 28 |
int j; |
| 29 |
public: |
| 30 |
Y (int i, int j) : X(i), j(j){} |
| 31 |
virtual int frob () const; |
| 32 |
}; |
| 33 |
|
| 34 |
int Y::frob () const |
| 35 |
{ |
| 36 |
return *this + j; |
| 37 |
} |
| 38 |
|
| 39 |
export enum Plain {A, B, C, D}; |
| 40 |
export enum class Scoped {A, B, C, D}; |
| 41 |
} |