https://bugs.llvm.org/show_bug.cgi?id=45614
[[nodiscard]] after a macro doesn't behave the same as an attribute resulting in incorrect indentation
This revision corrects that behavior
MACRO
__attribute__((warn_unused_result)) int f3(); // ok
MACRO
[[nodiscard]] int
f4(); // bad: unexpectedly indented!See original Mozilla bug:
https://bugzilla.mozilla.org/show_bug.cgi?id=1629756
Before:
class FooWidget : public nsBaseWidget {
public:
FooWidget();
NS_DECL_ISUPPORTS_INHERITED
[[nodiscard]] nsresult
FunctionOne();
[[nodiscard]] nsresult FunctionTwo();
};After:
class FooWidget : public nsBaseWidget {
public:
FooWidget();
NS_DECL_ISUPPORTS_INHERITED
[[nodiscard]] nsresult FunctionOne();
[[nodiscard]] nsresult FunctionTwo();
};
nit: pass Tok by const reference (makes sure we don't have to deal with nullptr and as bonus will make this patch diff smaller).