Compilation by recent clang++ on Mac (Apple LLVM version 7.0.2 (clang-700.1.81)) is broken.
It complain on 3 issues with templates like failing to void-reference
instantiation, and 2 issues in in visibility of resolving.
There's one more issue at the linking step.
The patch is attached and inlined.
Thank you so much for the great aspell!
Best.
Hypo
diff -Naru aspell-0.61/common/hash.hpp aspell-0.61-mac-patched/common/hash.hpp
--- aspell-0.61/common/hash.hpp 2016-02-22 14:58:15.000000000 +0200
+++ aspell-0.61-mac-patched/common/hash.hpp 2016-02-22 17:02:55.000000000 +0200
@@ -324,7 +324,7 @@
: Base(s, Parms(h,e)) {}
data_type & operator[](const key_type & k)
{
- return (*((insert(value_type(k, data_type()))).first)).second;
+ return (*((this->insert(value_type(k, data_type()))).first)).second;
}
};
diff -Naru aspell-0.61/common/posib_err.hpp aspell-0.61-mac-patched/common/posib_err.hpp
--- aspell-0.61/common/posib_err.hpp 2005-05-03 08:08:19.000000000 +0300
+++ aspell-0.61-mac-patched/common/posib_err.hpp 2016-02-22 17:02:42.000000000 +0200
@@ -158,6 +158,9 @@
void del();
};
+ template <typename Ret> class PosibErr;
+ template <> class PosibErr<void>;
+
template <typename Ret>
class PosibErr : public PosibErrBase
{
@@ -171,8 +174,8 @@
PosibErr(const PosibErr<T> & other)
: PosibErrBase(other), data(other.data) {}
- PosibErr(const PosibErr<void> & other)
- : PosibErrBase(other) {}
+ PosibErr(const PosibErr<void> & other);
+ //: PosibErrBase(other) {}
PosibErr& operator= (const PosibErr & other) {
data = "">@@ -186,6 +189,7 @@
Ret data;
};
+
template <>
class PosibErr<void> : public PosibErrBase
{
@@ -196,6 +200,10 @@
PosibErr() {}
};
+ template <typename Ret>
+ PosibErr<Ret>::PosibErr(const PosibErr<void> & other) : PosibErrBase(other) {}
+
+
//
//
//
diff -Naru aspell-0.61/common/vector.hpp aspell-0.61-mac-patched/common/vector.hpp
--- aspell-0.61/common/vector.hpp 2006-11-24 16:36:50.000000000 +0200
+++ aspell-0.61-mac-patched/common/vector.hpp 2016-02-22 17:02:49.000000000 +0200
@@ -35,7 +35,7 @@
this->push_back(t);
}
void append(const T * begin, unsigned int size) {
- insert(this->end(), begin, begin+size);
+ this->insert(this->end(), begin, begin+size);
}
void append(const T * begin, const T * end) {
insert(this->end(), begin, end);
diff -Naru aspell-0.61/interfaces/cc/aspell.h aspell-0.61-mac-patched/interfaces/cc/aspell.h
--- aspell-0.61/interfaces/cc/aspell.h 2016-02-22 14:56:26.000000000 +0200
+++ aspell-0.61-mac-patched/interfaces/cc/aspell.h 2016-02-22 17:03:18.000000000 +0200
@@ -237,7 +237,7 @@
/******************************** errors ********************************/
-
+#ifndef __cplusplus
extern const struct AspellErrorInfo * const aerror_other;
extern const struct AspellErrorInfo * const aerror_operation_not_supported;
extern const struct AspellErrorInfo * const aerror_cant_copy;
@@ -328,6 +328,7 @@
extern const struct AspellErrorInfo * const aerror_invalid_expression;
extern const struct AspellErrorInfo * const aerror_convert_filter;
extern const struct AspellErrorInfo * const aerror_invalid_table_entry;
+#endif
/****************************** check info ******************************/