Skip to content

Commit

Permalink
Fix minor compiler warnings that only show on Bazel.
Browse files Browse the repository at this point in the history
  - Explicitly invoke function being used in static_assert for arg validation.
  - Remove unused definitions in function traits test.

Test: bazel test  --cxxopt='-std=c++17' --repo_env=CC=clang ...
PiperOrigin-RevId: 447758825
Change-Id: I92264d702522403498eb9f140506399548473c17
  • Loading branch information
jwhpryor committed May 10, 2022
1 parent 94ce324 commit fe35655
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion implementation/method_selection.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ struct PermutationSelectionForArgs {
typename MethodSelectionForArgs::template FindPermutation<Args...>;

static constexpr bool kIsValidArgSet =
MethodSelectionForArgs::template ArgSetViable<Args...>;
MethodSelectionForArgs::template ArgSetViable<Args...>();

using PermutationRef = PermutationRef<MethodSelectionForArgs, OverloadSelectionForArgs,
PermutationForArgs>;
Expand Down
12 changes: 12 additions & 0 deletions metaprogramming/function_traits_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,4 +124,16 @@ TEST(FunctionTraits, MemberFunctions) {
int>);
}

TEST(FunctionTraits,
UseFunctionsSoCompilerDoesntEmitWarningsAboutDiscardingThem) {
VFoo();
VFoo_I(1);
VFoo_II(1, 2);
VFoo_III(1, 2, 3);

VFoo_F(1.f);
VFoo_FF(1.f, 2.f);
VFoo_FFF(1.f, 2.f, 3.f);
}

} // namespace

0 comments on commit fe35655

Please sign in to comment.