Skip to content

Commit

Permalink
clang/APINotes: squelch a -Wparantheses warning (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
artagnon committed Nov 24, 2023
1 parent 25b5e5c commit 59edb43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/include/clang/APINotes/APINotesManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class APINotesManager {
ArrayRef<APINotesReader *> getCurrentModuleReaders() const {
bool HasPublic = CurrentModuleReaders[ReaderKind::Public];
bool HasPrivate = CurrentModuleReaders[ReaderKind::Private];
assert(!HasPrivate || HasPublic && "private module requires public module");
assert(!HasPrivate || (HasPublic && "private module requires public module"));

This comment has been minimized.

Copy link
@dwblaikie

dwblaikie Nov 28, 2023

Collaborator

While it doesn't matter in terms of the semantics of this test, I think probably the suitable parentheses would be like this:

assert((!HasPrivate || HasPublic) && "...");

Could you change it to that?

This comment has been minimized.

Copy link
@artagnon

artagnon Nov 29, 2023

Author Contributor

Done. Sorry about the minor delay.

This comment has been minimized.

Copy link
@dwblaikie

dwblaikie Nov 29, 2023

Collaborator

No worries at all - thanks for coming around to it! (no big deal in this case - but can be handy/if you can, to include the commit hash on follow-up comments like this to tie everything together/so folks can follow the connection from the comment/cleanup to the patch that did it, etc) - in this case it looks like it was 2f1399c - thanks again!

if (!HasPrivate && !HasPublic)
return {};
return ArrayRef(CurrentModuleReaders).slice(0, HasPrivate ? 2 : 1);
Expand Down

0 comments on commit 59edb43

Please sign in to comment.