[AArch64] Fix SVE testsuite failures for ILP32 (PR 83846)
[official-gcc.git] / gcc / testsuite / g++.dg / template / pr61745.C
blob0f7c280e52ae6ddd2dfde5c7ca96381a93ccc992
1 // PR c++/61745
3 template <typename INT,INT P> class Zp;
5 template <typename INT,INT P> 
6 Zp<INT,P> operator-(const Zp<INT,P>& a, const Zp<INT,P>& b);
8 template <typename INT,INT P>
9 class Zp {
10 public:
11   static const INT p = P;
12 private:
13   INT val;
14 public:
15   Zp() : val(0) {}
16   Zp( INT x ) : val(x%p) { if (x < 0 ) x+= p; }
18   // this compiles only if the following definition is moved
19   // AFTER the friend declaration
20   Zp  operator-() const { return Zp(p-val); }
21   friend Zp<INT,P> operator- <>(const Zp<INT,P>& a, const Zp<INT,P>& b); // { dg-error "declaration|expected" }