| 1 |
// PR c++/44625 |
| 2 |
// { dg-do compile } |
| 3 |
// { dg-options "-Wno-return-type" } |
| 4 |
|
| 5 |
template<typename FP_> struct Vec { // { dg-message "note" "" { target c++17_down } } |
| 6 |
Vec& operator^=(Vec& rhs) { |
| 7 |
union { |
| 8 |
struct {FP_ x,y,z;}; // { dg-error "20:anonymous struct" } |
| 9 |
}; |
| 10 |
X = y*rhs.z() - z*rhs.y(); // { dg-error "not declared|no member" } |
| 11 |
} |
| 12 |
Vec& operator^(Vec& rhs) { |
| 13 |
return Vec(*this)^=rhs; |
| 14 |
} |
| 15 |
}; |
| 16 |
Vec<double> v(3,4,12); // { dg-error "no matching|too many initializers" } |
| 17 |
Vec<double> V(12,4,3); // { dg-error "no matching|too many initializers" } |
| 18 |
Vec<double> c = v^V; |