Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/bison/, sys-devel/bison/files/
Date: Tue, 21 Nov 2017 18:40:32
Message-Id: 1511289614.c284480b5e7e390aa76810e158eeae5b5c4beb54.whissi@gentoo
1 commit: c284480b5e7e390aa76810e158eeae5b5c4beb54
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Nov 21 18:40:00 2017 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Nov 21 18:40:14 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c284480b
7
8 sys-devel/bison: Fix test suite when using GCC 7
9
10 Closes: https://bugs.gentoo.org/638308
11 Package-Manager: Portage-2.3.13, Repoman-2.3.4
12
13 sys-devel/bison/bison-3.0.4-r1.ebuild | 1 +
14 .../bison/files/bison-3.0.4-fix-tests-gcc-7.patch | 151 +++++++++++++++++++++
15 2 files changed, 152 insertions(+)
16
17 diff --git a/sys-devel/bison/bison-3.0.4-r1.ebuild b/sys-devel/bison/bison-3.0.4-r1.ebuild
18 index ab8dcc62aa6..3672e2275c1 100644
19 --- a/sys-devel/bison/bison-3.0.4-r1.ebuild
20 +++ b/sys-devel/bison/bison-3.0.4-r1.ebuild
21 @@ -26,6 +26,7 @@ DOCS=( AUTHORS ChangeLog-2012 NEWS README THANKS TODO ) # ChangeLog-1998 PACKAGI
22 src_prepare() {
23 epatch "${FILESDIR}"/${P}-optional-perl.patch #538300
24 epatch "${FILESDIR}"/${P}-darwin17-printf-n.patch #632500
25 + epatch "${FILESDIR}"/${P}-fix-tests-gcc-7.patch #638308
26 # The makefiles make the man page depend on the configure script
27 # which we patched above. Touch it to prevent regeneration.
28 touch doc/bison.1 #548778 #538300#9
29
30 diff --git a/sys-devel/bison/files/bison-3.0.4-fix-tests-gcc-7.patch b/sys-devel/bison/files/bison-3.0.4-fix-tests-gcc-7.patch
31 new file mode 100644
32 index 00000000000..89fc5f6c39a
33 --- /dev/null
34 +++ b/sys-devel/bison/files/bison-3.0.4-fix-tests-gcc-7.patch
35 @@ -0,0 +1,151 @@
36 +commit 952416114729b95209dccfc4edacfc1ff13b4e82
37 +Author: Akim Demaille <akim@××××××××××.fr>
38 +Date: Mon Jan 26 18:23:12 2015 +0100
39 +
40 + tests: c++: fix symbol lookup issue
41 +
42 + Sun C 5.13 SunOS_sparc 2014/10/20 reports errors on tests 430-432.
43 +
44 + Reported by Dennis Clarke.
45 + <http://lists.gnu.org/archive/html/bug-bison/2015-01/msg00087.html>
46 +
47 + * tests/c++.at (Variants): Be sure to emit operator<< before using it:
48 + use "%code top" rather than "%code".
49 + Prefer std::vector to std::list.
50 + Do not define anything in std::, to avoid undefined behavior.
51 +
52 +diff --git a/tests/c++.at b/tests/c++.at
53 +index 55d7d40..60292f4 100644
54 +--- a/tests/c++.at
55 ++++ b/tests/c++.at
56 +@@ -96,7 +96,7 @@ AT_SETUP([C++ Variant-based Symbols])
57 + AT_KEYWORDS([variant])
58 +
59 + AT_BISON_OPTION_PUSHDEFS([%skeleton "lalr1.cc" %debug $1])
60 +-# Store strings and integers in a list of strings.
61 ++# Store strings and integers in a vector of strings.
62 + AT_DATA_GRAMMAR([list.y],
63 + [[%skeleton "lalr1.cc"
64 + %define api.value.type variant
65 +@@ -114,20 +114,20 @@ AT_DATA_GRAMMAR([list.y],
66 + }
67 +
68 + %token <int> INT "int"
69 +-%type < std::list<int> > exp
70 ++%type < std::vector<int> > exp
71 +
72 + %printer { yyo << $$; } <int>
73 + %printer
74 + {
75 +- for (std::list<int>::const_iterator i = $$.begin (); i != $$.end (); ++i)
76 ++ for (std::vector<int>::const_iterator i = $$.begin (); i != $$.end (); ++i)
77 + {
78 + if (i != $$.begin ())
79 + yyo << ", ";
80 + yyo << *i;
81 + }
82 +- } < std::list<int> >
83 ++ } < std::vector<int> >
84 +
85 +-%code requires { #include <list> }
86 ++%code requires { #include <vector> }
87 + %code { int yylex (yy::parser::semantic_type* yylval); }
88 +
89 + %%
90 +@@ -185,7 +185,7 @@ m4_pushdef([AT_TEST],
91 + [AT_SETUP([Variants $1])
92 +
93 + AT_BISON_OPTION_PUSHDEFS([%debug $1])
94 +-# Store strings and integers in a list of strings.
95 ++# Store strings and integers in a vector of strings.
96 + AT_DATA_GRAMMAR([list.y],
97 + [[%debug
98 + %define api.value.type variant
99 +@@ -194,29 +194,25 @@ AT_DATA_GRAMMAR([list.y],
100 +
101 + %code requires // code for the .hh file
102 + {
103 +-#include <list>
104 ++#include <vector>
105 + #include <string>
106 +-typedef std::list<std::string> strings_type;
107 ++typedef std::vector<std::string> strings_type;
108 + }
109 +
110 +-%code // code for the .cc file
111 ++%code top // code for the .cc file.
112 + {
113 + #include <cstdlib> // abort, getenv
114 + #include <iostream>
115 ++#include <vector>
116 + #include <sstream>
117 ++#include <string>
118 +
119 +- namespace yy
120 +- {
121 +- static]AT_TOKEN_CTOR_IF([[
122 +- parser::symbol_type yylex ()]], [[
123 +- parser::token_type yylex (parser::semantic_type* yylval]AT_LOCATION_IF([,
124 +- parser::location_type* yylloc])[)]])[;
125 +- }
126 +
127 +- // Printing a list of strings (for %printer).
128 +- // Koening look up will look into std, since that's an std::list.
129 +- namespace std
130 ++ typedef std::vector<std::string> strings_type;
131 ++
132 ++ namespace yy
133 + {
134 ++ // Must be available early, as is used in %destructor.
135 + std::ostream&
136 + operator<<(std::ostream& o, const strings_type& s)
137 + {
138 +@@ -230,16 +226,27 @@ typedef std::list<std::string> strings_type;
139 + return o << ')';
140 + }
141 + }
142 ++}
143 +
144 +- // Conversion to string.
145 +- template <typename T>
146 +- inline
147 +- std::string
148 +- to_string (const T& t)
149 ++%code // code for the .cc file.
150 ++{
151 ++ namespace yy
152 + {
153 +- std::ostringstream o;
154 +- o << t;
155 +- return o.str ();
156 ++ static]AT_TOKEN_CTOR_IF([[
157 ++ parser::symbol_type yylex ()]], [[
158 ++ parser::token_type yylex (parser::semantic_type* yylval]AT_LOCATION_IF([,
159 ++ parser::location_type* yylloc])[)]])[;
160 ++
161 ++ // Conversion to string.
162 ++ template <typename T>
163 ++ inline
164 ++ std::string
165 ++ to_string (const T& t)
166 ++ {
167 ++ std::ostringstream o;
168 ++ o << t;
169 ++ return o.str ();
170 ++ }
171 + }
172 + }
173 +
174 +@@ -252,10 +259,10 @@ typedef std::list<std::string> strings_type;
175 + // Using the template type to exercize its parsing.
176 + // Starting with :: to ensure we don't output "<::" which starts by the
177 + // digraph for the left square bracket.
178 +-%type <::std::list<std::string>> list;
179 ++%type <::std::vector<std::string>> list;
180 +
181 + %printer { yyo << $$; }
182 +- <int> <::std::string> <::std::list<std::string>>;
183 ++ <int> <::std::string> <::std::vector<std::string>>;
184 + %destructor { std::cerr << "Destroy: " << $$ << '\n'; } <*>;
185 + %destructor { std::cerr << "Destroy: \"" << $$ << "\"\n"; } <::std::string>;
186 + %%