Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp2a/spaceship-eq1a.C @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | |
children |
rev | line source |
---|---|
145 | 1 // { dg-do run { target c++2a } } |
2 | |
3 template <class T> | |
4 struct D | |
5 { | |
6 T i; | |
7 bool operator==(const D& x) const = default; // OK, returns x.i == y.i | |
8 bool operator!=(const D& z) const = default; // OK, returns !(*this == z) | |
9 }; | |
10 | |
11 #define assert(X) do { if (!(X)) __builtin_abort(); } while (0) | |
12 | |
13 template <class T> | |
14 void f() | |
15 { | |
16 D<T> d{42}; | |
17 assert (d == d); | |
18 assert (!(d != d)); | |
19 } | |
20 | |
21 int main() | |
22 { | |
23 f<int>(); | |
24 } |