From 20a2e6afa82c165bcd1a8749478e9402a25088a4 Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 22 Jun 2020 20:15:36 +0100 Subject: [PATCH] recog: Restore builds with Clang Using parameter packs with function typedefs tripped a Clang bug in which the packs were not being expanded correctly: https://bugs.llvm.org/show_bug.cgi?id=46377 Work around that by going back to the decltype approach, but adding a cast to void to suppress a warning about unused values. 2020-06-22 Richard Sandiford gcc/ * coretypes.h (first_type): Delete. * recog.h (insn_gen_fn::operator()): Go back to using a decltype. --- gcc/coretypes.h | 4 ---- gcc/recog.h | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/gcc/coretypes.h b/gcc/coretypes.h index 720f9f9c63f..6b6cfcdf210 100644 --- a/gcc/coretypes.h +++ b/gcc/coretypes.h @@ -359,10 +359,6 @@ struct kv_pair const ValueType value; /* the value of the name */ }; -/* Alias of the first type, ignoring the second. */ -template -using first_type = T1; - /* Iterator pair used for a collection iteration with range-based loops. */ template diff --git a/gcc/recog.h b/gcc/recog.h index d674d384723..3e4b55bdf3f 100644 --- a/gcc/recog.h +++ b/gcc/recog.h @@ -297,7 +297,7 @@ struct insn_gen_fn template rtx_insn *operator() (Ts... args) const { - typedef rtx_insn *(*funcptr) (first_type...); + typedef rtx_insn *(*funcptr) (decltype ((void) args, NULL_RTX)...); return ((funcptr) func) (args...); } -- 2.30.2