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