summaryrefslogtreecommitdiff
path: root/gcc/recog.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2020-06-17 17:45:29 +0100
committerRichard Sandiford <richard.sandiford@arm.com>2020-06-17 17:45:29 +0100
commit4e49b994de060d4a6c9318d0ed52ef038153426e (patch)
tree967c862c5093961c5e54254cfaa0820e38a530a1 /gcc/recog.h
parent914eadfe86a0400e0e378819001c785ecb30aab2 (diff)
recog: Tweak insn_gen_fn::operator() definition
Fixes a “left operand of comma has no effect” warning that some were seeing. Also fixes a spurious ellipsis that Jonathan Wakely pointed out. 2020-06-17 Richard Sandiford <richard.sandiford@arm.com> gcc/ * coretypes.h (first_type): New alias template. * recog.h (insn_gen_fn::operator()): Use it instead of a decltype. Remove spurious “...” and split the function type out into a typedef.
Diffstat (limited to 'gcc/recog.h')
-rw-r--r--gcc/recog.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/recog.h b/gcc/recog.h
index 0a71a02c4a9..d674d384723 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -295,9 +295,10 @@ struct insn_gen_fn
typedef void (*stored_funcptr) (void);
template<typename ...Ts>
- rtx_insn *operator() (Ts... args...) const
+ rtx_insn *operator() (Ts... args) const
{
- return ((rtx_insn *(*) (decltype(args, NULL_RTX)...)) func) (args...);
+ typedef rtx_insn *(*funcptr) (first_type<rtx, Ts>...);
+ return ((funcptr) func) (args...);
}
// This is for compatibility of code that invokes functions like