| 1 |
// { dg-additional-options "-fmodules-ts" } |
| 2 |
|
| 3 |
// 'import X' does not correctly notice that S has already been declared. |
| 4 |
struct S {}; // { dg-message "previous declaration" "" { xfail *-*-* } } |
| 5 |
template <typename> struct T {}; // { dg-message "previous declaration" } |
| 6 |
void f() {} // { dg-message "previously declared" } |
| 7 |
template <typename T> void g() {} // { dg-message "previously declared" } |
| 8 |
|
| 9 |
import X; |
| 10 |
A<double> a2; // { dg-message "required from here" } |
| 11 |
B<double> b2; // { dg-message "required from here" } |
| 12 |
|
| 13 |
// specifically, S and T are defined in M, not X, despite the instantiation being in X |
| 14 |
// { dg-error "conflicting declaration \[^\n\r\]* S@M" "" { xfail *-*-* } 0 } |
| 15 |
// { dg-error "conflicting declaration \[^\n\r\]* T@M" "" { target *-*-* } 0 } |
| 16 |
// and similarly for f and g |
| 17 |
// { dg-error "conflicting declaration \[^\n\r\]* f@M" "" { target *-*-* } 0 } |
| 18 |
// { dg-error "conflicting declaration \[^\n\r\]* g@M" "" { target *-*-* } 0 } |