Commit a34136a3 authored by cmasone's avatar cmasone Committed by Commit bot

Work around a parameter-unused-but-set warning in gin/

GCC thinks that the create_flags parameter in the templated class
gin::Invoker constructor is going unused, even though it is definitely
being used as a part of a variadic template expansion. Convince GCC
that it is in fact being used by casting it to a void.

BUG=424334
TEST=Linux GN build of gin with is_clang=false
R=aa

Review URL: https://codereview.chromium.org/694063002

Cr-Commit-Position: refs/heads/master@{#302361}
parent 31783d4f
......@@ -150,8 +150,13 @@ class Invoker<IndicesHolder<indices...>, ArgTypes...>
// so it is guaranteed ArgumentHolders will be initialized (and thus, will
// extract arguments from Arguments) in the right order.
Invoker(Arguments* args, int create_flags)
: ArgumentHolder<indices, ArgTypes>(args, create_flags)...,
args_(args) {}
: ArgumentHolder<indices, ArgTypes>(args, create_flags)..., args_(args) {
// GCC thinks that create_flags is going unused, even though the
// expansion above clearly makes use of it. Per jyasskin@, casting
// to void is the commonly accepted way to convince the compiler
// that you're actually using a parameter/varible.
(void)create_flags;
}
bool IsOK() {
return And(ArgumentHolder<indices, ArgTypes>::ok...);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment