blob: a30251dc79dcd5a4f47749a12fb79dd09ed4fcb0 [file] [log] [blame]
// { dg-do compile { target c++17 } }
// Don't add built-in operator for ++ on bool.
template<typename T>
struct S { operator T&(); };
template<int> void
foo (S<bool>& s)
{
--s; // { dg-error "no match for" }
++s; // { dg-error "no match for" }
s++; // { dg-error "declared for postfix" }
s--; // { dg-error "declared for postfix" }
}
void
bar ()
{
S<bool> s;
foo<0> (s);
}