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  <richard.sandiford@arm.com>

gcc/
	* coretypes.h (first_type): Delete.
	* recog.h (insn_gen_fn::operator()): Go back to using a decltype.
This commit is contained in:
Richard Sandiford 2020-06-22 20:15:36 +01:00
parent 99abb146fd
commit 20a2e6afa8
2 changed files with 1 additions and 5 deletions

View File

@ -359,10 +359,6 @@ struct kv_pair
const ValueType value; /* the value of the name */
};
/* Alias of the first type, ignoring the second. */
template<typename T1, typename T2>
using first_type = T1;
/* Iterator pair used for a collection iteration with range-based loops. */
template<typename T>

View File

@ -297,7 +297,7 @@ struct insn_gen_fn
template<typename ...Ts>
rtx_insn *operator() (Ts... args) const
{
typedef rtx_insn *(*funcptr) (first_type<rtx, Ts>...);
typedef rtx_insn *(*funcptr) (decltype ((void) args, NULL_RTX)...);
return ((funcptr) func) (args...);
}