summaryrefslogtreecommitdiffstats
path: root/build/clang-plugin/tests/TestExplicitOperatorBool.cpp
blob: bc4b43a7d06ae6b1e748c8b141b1d1927cf06b88 (plain)
1
2
3
4
5
6
7
8
9
10
11
#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();
};