Debian Codegraph @

gcc/testsuite/g++.dg/ext/attr-unavailable-3.C

raw
1 /* Check operator with __attribute__((unavailable)) */
2 /* { dg-do compile } */
3 /* { dg-options "" } */
4
5 struct Foo
6 {
7 operator int() __attribute__((unavailable));
8 };
9
10 void g(void)
11 {
12 Foo f;
13 (int)f; // { dg-error "'Foo::operator int\\(\\)' is unavailable" }
14 }