comparison gcc/testsuite/g++.dg/overload/builtin5.C @ 152:2b5abeee2509

update gcc11
author anatofuz
date Mon, 25 May 2020 07:50:57 +0900
parents
children
comparison
equal deleted inserted replaced
145:1830386684a0 152:2b5abeee2509
1 // { dg-do compile { target c++17 } }
2 // Don't add built-in operator for ++ on bool.
3
4 template<typename T>
5 struct S { operator T&(); };
6
7 template<int> void
8 foo (S<bool>& s)
9 {
10 --s; // { dg-error "no match for" }
11 ++s; // { dg-error "no match for" }
12 s++; // { dg-error "declared for postfix" }
13 s--; // { dg-error "declared for postfix" }
14 }
15
16 void
17 bar ()
18 {
19 S<bool> s;
20 foo<0> (s);
21 }