summaryrefslogtreecommitdiffstats
path: root/gin
diff options
context:
space:
mode:
authorcmasone <cmasone@chromium.org>2014-10-31 17:10:47 -0700
committerCommit bot <commit-bot@chromium.org>2014-11-01 00:11:30 +0000
commita34136a3c2eeefab5e700633e317ecb1428602de (patch)
tree9c580873d3d3a8dcfbae57926cf1e99d3c2b25fe /gin
parent31783d4f0dc2aea193d19cdd697b5e5e440d0c72 (diff)
downloadchromium_src-a34136a3c2eeefab5e700633e317ecb1428602de.zip
chromium_src-a34136a3c2eeefab5e700633e317ecb1428602de.tar.gz
chromium_src-a34136a3c2eeefab5e700633e317ecb1428602de.tar.bz2
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}
Diffstat (limited to 'gin')
-rw-r--r--gin/function_template.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/gin/function_template.h b/gin/function_template.h
index 955ff53..2b66b66 100644
--- a/gin/function_template.h
+++ b/gin/function_template.h
@@ -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...);