tenfourfox/build/clang-plugin/tests/TestExplicitOperatorBool.cpp
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

12 lines
332 B
C++

#define MOZ_IMPLICIT __attribute__((annotate("moz_implicit")))
struct Bad {
operator bool(); // expected-error {{bad implicit conversion operator for 'Bad'}} expected-note {{consider adding the explicit keyword to 'operator bool'}}
};
struct Good {
explicit operator bool();
};
struct Okay {
MOZ_IMPLICIT operator bool();
};