1 |
commit: 6c936b92ef0757dbd6d46123124f4f898babadc8 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Aug 27 06:59:46 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 27 07:00:03 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6c936b92 |
7 |
|
8 |
dev-util/source-highlight: fix tests on clang |
9 |
|
10 |
Reported-by: Agostino Sarubbo |
11 |
Closes: https://bugs.gentoo.org/739036 |
12 |
Package-Manager: Portage-3.0.4, Repoman-3.0.1 |
13 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
14 |
|
15 |
.../source-highlight-3.1.9-test-clang-p1.patch | 30 +++++++++++++++++ |
16 |
.../source-highlight-3.1.9-test-clang-p2.patch | 39 ++++++++++++++++++++++ |
17 |
.../source-highlight/source-highlight-3.1.9.ebuild | 5 +++ |
18 |
3 files changed, 74 insertions(+) |
19 |
|
20 |
diff --git a/dev-util/source-highlight/files/source-highlight-3.1.9-test-clang-p1.patch b/dev-util/source-highlight/files/source-highlight-3.1.9-test-clang-p1.patch |
21 |
new file mode 100644 |
22 |
index 00000000000..6b0bad369b8 |
23 |
--- /dev/null |
24 |
+++ b/dev-util/source-highlight/files/source-highlight-3.1.9-test-clang-p1.patch |
25 |
@@ -0,0 +1,30 @@ |
26 |
+From b3481e66f2014dece48d8dfe8affa416d8d4e104 Mon Sep 17 00:00:00 2001 |
27 |
+From: Sergei Trofimovich <slyfox@g.o> |
28 |
+Date: Thu, 27 Aug 2020 07:51:14 +0100 |
29 |
+Subject: [PATCH 1/2] lib/tests/stdboosterror.h: use unambiguous form of |
30 |
+ variable declaration |
31 |
+ |
32 |
+Original expression has an ambiguity and should not compile: |
33 |
+https://gcc.gnu.org/PR86564 |
34 |
+ |
35 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
36 |
+--- |
37 |
+ lib/tests/stdboosterror.h | 2 +- |
38 |
+ 1 file changed, 1 insertion(+), 1 deletion(-) |
39 |
+ |
40 |
+diff --git a/lib/tests/stdboosterror.h b/lib/tests/stdboosterror.h |
41 |
+index 568545b..d59bfa6 100644 |
42 |
+--- a/lib/tests/stdboosterror.h |
43 |
++++ b/lib/tests/stdboosterror.h |
44 |
+@@ -4,7 +4,7 @@ |
45 |
+ #include <boost/regex/pattern_except.hpp> |
46 |
+ |
47 |
+ static boost::regex_error |
48 |
+- std_boost_exception(boost::regex_error(boost::regex_constants::error_bad_pattern)); |
49 |
++ std_boost_exception = boost::regex_error(boost::regex_constants::error_bad_pattern); |
50 |
+ |
51 |
+ /** |
52 |
+ * returns the string representing a standard exception (which |
53 |
+-- |
54 |
+2.28.0 |
55 |
+ |
56 |
|
57 |
diff --git a/dev-util/source-highlight/files/source-highlight-3.1.9-test-clang-p2.patch b/dev-util/source-highlight/files/source-highlight-3.1.9-test-clang-p2.patch |
58 |
new file mode 100644 |
59 |
index 00000000000..4c34f9dcca5 |
60 |
--- /dev/null |
61 |
+++ b/dev-util/source-highlight/files/source-highlight-3.1.9-test-clang-p2.patch |
62 |
@@ -0,0 +1,39 @@ |
63 |
+From 4d53621557de31479dad3cb44b7fccba8277b76d Mon Sep 17 00:00:00 2001 |
64 |
+From: Sergei Trofimovich <slyfox@g.o> |
65 |
+Date: Thu, 27 Aug 2020 07:52:25 +0100 |
66 |
+Subject: [PATCH 2/2] lib/tests/test_wordtokenizer_main.cpp: insert overload to |
67 |
+ std namespace |
68 |
+ |
69 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
70 |
+--- |
71 |
+ lib/tests/test_wordtokenizer_main.cpp | 7 ++++--- |
72 |
+ 1 file changed, 4 insertions(+), 3 deletions(-) |
73 |
+ |
74 |
+diff --git a/lib/tests/test_wordtokenizer_main.cpp b/lib/tests/test_wordtokenizer_main.cpp |
75 |
+index 40e23b1..02e8fd8 100644 |
76 |
+--- a/lib/tests/test_wordtokenizer_main.cpp |
77 |
++++ b/lib/tests/test_wordtokenizer_main.cpp |
78 |
+@@ -11,9 +11,9 @@ |
79 |
+ using namespace std; |
80 |
+ using namespace srchilite; |
81 |
+ |
82 |
+-static ostream &operator <<(ostream &os, const WordTokenizer::WordTokenizerResults::value_type &); |
83 |
+- |
84 |
+-ostream &operator <<(ostream &os, const WordTokenizer::WordTokenizerResults::value_type &token) { |
85 |
++/* Argument-dependent lookup looks only at std:: namespace (ostream and value_type expansion) */ |
86 |
++namespace std { |
87 |
++static ostream &operator <<(ostream &os, const WordTokenizer::WordTokenizerResults::value_type &token) { |
88 |
+ if (token.first.size()) { |
89 |
+ os << "space: \"" << token.first << "\"" << endl; |
90 |
+ } else { |
91 |
+@@ -22,6 +22,7 @@ ostream &operator <<(ostream &os, const WordTokenizer::WordTokenizerResults::val |
92 |
+ |
93 |
+ return os; |
94 |
+ } |
95 |
++} |
96 |
+ |
97 |
+ int main() { |
98 |
+ WordTokenizer::WordTokenizerResults tokens; |
99 |
+-- |
100 |
+2.28.0 |
101 |
+ |
102 |
|
103 |
diff --git a/dev-util/source-highlight/source-highlight-3.1.9.ebuild b/dev-util/source-highlight/source-highlight-3.1.9.ebuild |
104 |
index cbf7b16e377..3568b4c32e0 100644 |
105 |
--- a/dev-util/source-highlight/source-highlight-3.1.9.ebuild |
106 |
+++ b/dev-util/source-highlight/source-highlight-3.1.9.ebuild |
107 |
@@ -18,6 +18,11 @@ RDEPEND=">=dev-libs/boost-1.62.0:=[threads] |
108 |
DEPEND="${RDEPEND}" |
109 |
BDEPEND="" |
110 |
|
111 |
+PATCHES=( |
112 |
+ "${FILESDIR}"/${PN}-3.1.9-test-clang-p1.patch |
113 |
+ "${FILESDIR}"/${PN}-3.1.9-test-clang-p2.patch |
114 |
+) |
115 |
+ |
116 |
src_configure() { |
117 |
# required as rev-dep of dev-libs/boost-1.62.0 |
118 |
# https://wiki.gentoo.org/wiki/Project:C%2B%2B/Maintaining_ABI |