mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
d278570d19
This is the counterpart to the existing analysis to catch constructors which aren't marked as either explicit or MOZ_IMPLICIT.
12 lines
332 B
C++
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();
|
|
};
|