From: Nadav Har'El <n...@scylladb.com>
Committer: Nadav Har'El <n...@scylladb.com>
Branch: master

Fix compilation on gcc 8.1.1

In C++11, it is usually necessary to use the silly keyword "typename" when
referring to a member type in another template type, e.g.,
typename unaligned_copier<Width, Shift>::reg_file

In this specific file we didn't use "typename", and gcc used to accept it
until version 8.1.1, but no longer does and now requires the typename,
probably as a preparation for a future C++ standard which makes it NOT
necessary :-) So let's add the missing "typename" to allow it to compile.

Signed-off-by: Nadav Har'El <n...@scylladb.com>

---
diff --git a/arch/x64/string-ssse3.cc b/arch/x64/string-ssse3.cc
--- a/arch/x64/string-ssse3.cc
+++ b/arch/x64/string-ssse3.cc
@@ -79,7 +79,7 @@ struct unaligned_copier<Width, Shift>::loader {
 template <unsigned Width, unsigned Shift>
 template <typename Ignore>
 struct unaligned_copier<Width, Shift>::loader<Width, Ignore> {
-    using reg_file = unaligned_copier<Width, Shift>::reg_file;
+    using reg_file = typename unaligned_copier<Width, Shift>::reg_file;
     void operator()(reg_file& regs, const __m128i* src) {}
 };

@@ -99,7 +99,7 @@ struct unaligned_copier<Width, Shift>::shifter {
 template <unsigned Width, unsigned Shift>
 template <typename Ignore>
 struct unaligned_copier<Width, Shift>::shifter<Width, Ignore> {
-    using reg_file = unaligned_copier<Width, Shift>::reg_file;
+    using reg_file = typename unaligned_copier<Width, Shift>::reg_file;
     void operator()(reg_file& regs) {}
 };

@@ -117,7 +117,7 @@ struct unaligned_copier<Width, Shift>::storer {
 template <unsigned Width, unsigned Shift>
 template <typename Ignore>
 struct unaligned_copier<Width, Shift>::storer<Width, Ignore> {
-    using reg_file = unaligned_copier<Width, Shift>::reg_file;
+    using reg_file = typename unaligned_copier<Width, Shift>::reg_file;
     void operator()(reg_file& regs, __m128i* dest) {}
 };

--
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to