aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2020-06-22 20:15:36 +0100
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:14:30 -0300
commit738f065a4d048eca6d11909ac79e61191ca9752a (patch)
treeb6febeaadc99b3a4a23556ba6e406a347f489a47
parent4280ed186597991473003bd7434b6d1e659b74b1 (diff)
downloadgcc-738f065a4d048eca6d11909ac79e61191ca9752a.zip
gcc-738f065a4d048eca6d11909ac79e61191ca9752a.tar.gz
gcc-738f065a4d048eca6d11909ac79e61191ca9752a.tar.bz2
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.
-rw-r--r--gcc/coretypes.h4
-rw-r--r--gcc/recog.h2
2 files changed, 1 insertions, 5 deletions
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 720f9f9..6b6cfcd 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<typename T1, typename T2>
-using first_type = T1;
-
/* Iterator pair used for a collection iteration with range-based loops. */
template<typename T>
diff --git a/gcc/recog.h b/gcc/recog.h
index d674d38..3e4b55b 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -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...);
}