Skip to content

Commit

Permalink
Annotate explicitly not used function as such.
Browse files Browse the repository at this point in the history
These functions are explicitly there for a test scenario, so
should not be removed.

This keeps the clang-tidy [clang-diagnostic-unused-function] check
calm and relaxed about these.

#xls-build-gardener

PiperOrigin-RevId: 684112930
  • Loading branch information
hzeller authored and copybara-github committed Oct 9, 2024
1 parent adf30f9 commit 45e3cce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions xls/common/casts_nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ Derived3 WontCompile(Base& r) { return down_cast<Derived3>(r); }
// Finally, tests that good code does compile (i.e. the compiler is
// not blindly failing everything).

// NOLINTNEXTLINE(clang-diagnostic-unused-function)
static int Identity(int x) { return x; }

#endif
1 change: 1 addition & 0 deletions xls/common/strong_int_nc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class Explicit {
};

// Each case specified under each symbol must fail to compile.
// NOLINTNEXTLINE(clang-diagnostic-unused-function)
static void MustNotCompile() {
USD dollars(1);
(void)dollars; // Avoid unused variable warning.
Expand Down

0 comments on commit 45e3cce

Please sign in to comment.