Skip to content

Commit a374554

Browse files
committed
Update contrib/restricted/boost/graph to 1.86.0
29609809abb032ea449cf4b749abf84c9b9c4c1d
1 parent f5f12e9 commit a374554

File tree

9 files changed

+106
-77
lines changed

9 files changed

+106
-77
lines changed

contrib/restricted/boost/graph/include/boost/graph/detail/adjacency_list.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2189,8 +2189,12 @@ class vec_adj_list_impl : public adj_list_helper< Config, Base >
21892189
}
21902190
// Copy the edges by adding each edge and copying its
21912191
// property object.
2192+
#ifdef BOOST_NO_CXX17_STRUCTURED_BINDINGS
21922193
edge_iterator ei, ei_end;
21932194
for (boost::tie(ei, ei_end) = edges(x); ei != ei_end; ++ei)
2195+
#else // Silences -Wmaybe-uninitialized in adj_list_edge_iterator::operator++().
2196+
for (auto [ei, ei_end] = edges(x); ei != ei_end; ++ei)
2197+
#endif
21942198
{
21952199
edge_descriptor e;
21962200
bool inserted;

contrib/restricted/boost/graph/include/boost/graph/detail/read_graphviz_spirit.hpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ namespace detail
171171
= construct_< std::string >(arg1, arg2)];
172172

173173
a_list = list_p(
174-
ID[(a_list.key = arg1), (a_list.value = "true")] >> !(
174+
ID[((a_list.key = arg1), (a_list.value = "true"))] >> !(
175175
ch_p('=') >> ID[a_list.value = arg1])[phoenix::bind(
176176
&definition::call_prop_actor)(
177177
var(*this), a_list.key, a_list.value)],
@@ -213,8 +213,8 @@ namespace detail
213213
// (directed/undirected)
214214
edgeop = ch_p('-') >> ch_p(boost::ref(edge_head));
215215

216-
edgeRHS = +(edgeop[(data_stmt.sources = data_stmt.dests),
217-
(data_stmt.dests = construct_< nodes_t >())]
216+
edgeRHS = +(edgeop[((data_stmt.sources = data_stmt.dests),
217+
(data_stmt.dests = construct_< nodes_t >()))]
218218
>> (subgraph[data_stmt.dests = arg1]
219219
| node_id[phoenix::bind(&definition::insert_node)(
220220
var(*this), data_stmt.dests, arg1)])
@@ -225,18 +225,18 @@ namespace detail
225225
// To avoid backtracking, edge, node, and subgraph
226226
// statements are processed as one nonterminal.
227227
data_stmt
228-
= (subgraph[(data_stmt.dests
228+
= (subgraph[((data_stmt.dests
229229
= arg1), // will get moved in rhs
230-
(data_stmt.saw_node = false)]
231-
| node_id[(phoenix::bind(
230+
(data_stmt.saw_node = false))]
231+
| node_id[((phoenix::bind(
232232
&definition::insert_node)(
233233
var(*this), data_stmt.dests, arg1)),
234234
(data_stmt.saw_node = true),
235235
#ifdef BOOST_GRAPH_DEBUG
236236
(std::cout << val("AcTive Node: ") << arg1
237237
<< "\n"),
238238
#endif // BOOST_GRAPH_DEBUG
239-
(data_stmt.active_node = arg1)])
239+
(data_stmt.active_node = arg1))])
240240
>> if_p(edgeRHS)[!attr_list(actor_t(phoenix::bind(
241241
&definition::edge_prop)(
242242
var(*this), arg1, arg2)))]
@@ -252,11 +252,11 @@ namespace detail
252252
stmt_list = *(stmt >> !ch_p(';'));
253253

254254
subgraph = !(as_lower_d[keyword_p("subgraph")]
255-
>> (!ID[(subgraph.name = arg1),
255+
>> (!ID[((subgraph.name = arg1),
256256
(subgraph.nodes
257257
= (var(subgraph_nodes))[arg1]),
258258
(subgraph.edges
259-
= (var(subgraph_edges))[arg1])]))
259+
= (var(subgraph_edges))[arg1]))]))
260260
>> ch_p('{')[++var(subgraph_depth)] >> stmt_list
261261
>> ch_p('}')[--var(subgraph_depth)]
262262
[(var(subgraph_nodes))[subgraph.name]
@@ -265,19 +265,19 @@ namespace detail
265265
= subgraph.edges]
266266

267267
| as_lower_d[keyword_p("subgraph")]
268-
>> ID[(subgraph.nodes
268+
>> ID[((subgraph.nodes
269269
= (var(subgraph_nodes))[arg1]),
270-
(subgraph.edges = (var(subgraph_edges))[arg1])];
270+
(subgraph.edges = (var(subgraph_edges))[arg1]))];
271271

272272
the_grammar = (!as_lower_d[keyword_p("strict")])
273273
>> (as_lower_d[keyword_p(
274-
"graph")][(var(edge_head) = '-'),
274+
"graph")][((var(edge_head) = '-'),
275275
(phoenix::bind(&definition::check_undirected)(
276-
var(*this)))]
276+
var(*this))))]
277277
| as_lower_d[keyword_p(
278-
"digraph")][(var(edge_head) = '>'),
278+
"digraph")][((var(edge_head) = '>'),
279279
(phoenix::bind(&definition::check_directed)(
280-
var(*this)))])
280+
var(*this))))])
281281
>> (!ID) >> ch_p('{') >> stmt_list >> ch_p('}');
282282

283283
} // definition()

contrib/restricted/boost/graph/include/boost/graph/exception.hpp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#include <stdexcept>
1414
#include <string>
1515

16+
#include <boost/config.hpp>
17+
1618
namespace boost
1719
{
1820

@@ -51,6 +53,53 @@ struct BOOST_SYMBOL_VISIBLE not_complete : public bad_graph
5153
not_complete() : bad_graph("The graph must be complete.") {}
5254
};
5355

56+
struct BOOST_SYMBOL_VISIBLE graph_exception : public std::exception
57+
{
58+
~graph_exception() throw() BOOST_OVERRIDE {}
59+
const char* what() const throw() BOOST_OVERRIDE = 0;
60+
};
61+
62+
struct BOOST_SYMBOL_VISIBLE bad_parallel_edge : public graph_exception
63+
{
64+
std::string from;
65+
std::string to;
66+
mutable std::string statement;
67+
bad_parallel_edge(const std::string& i, const std::string& j)
68+
: from(i), to(j)
69+
{
70+
}
71+
72+
~bad_parallel_edge() throw() BOOST_OVERRIDE {}
73+
const char* what() const throw() BOOST_OVERRIDE
74+
{
75+
if (statement.empty())
76+
statement = std::string("Failed to add parallel edge: (") + from
77+
+ "," + to + ")\n";
78+
79+
return statement.c_str();
80+
}
81+
};
82+
83+
struct BOOST_SYMBOL_VISIBLE directed_graph_error : public graph_exception
84+
{
85+
~directed_graph_error() throw() BOOST_OVERRIDE {}
86+
const char* what() const throw() BOOST_OVERRIDE
87+
{
88+
return "read_graphviz: "
89+
"Tried to read a directed graph into an undirected graph.";
90+
}
91+
};
92+
93+
struct BOOST_SYMBOL_VISIBLE undirected_graph_error : public graph_exception
94+
{
95+
~undirected_graph_error() throw() BOOST_OVERRIDE {}
96+
const char* what() const throw() BOOST_OVERRIDE
97+
{
98+
return "read_graphviz: "
99+
"Tried to read an undirected graph into a directed graph.";
100+
}
101+
};
102+
54103
} // namespace boost
55104

56105
#endif // BOOST_GRAPH_EXCEPTION_HPP

contrib/restricted/boost/graph/include/boost/graph/graph_mutability_traits.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <boost/mpl/if.hpp>
1212
#include <boost/mpl/and.hpp>
1313
#include <boost/mpl/bool.hpp>
14+
#include <boost/type_traits/is_convertible.hpp>
1415
#include <boost/type_traits/is_same.hpp>
1516

1617
namespace boost

contrib/restricted/boost/graph/include/boost/graph/graphml.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,16 @@
1616
#include <boost/lexical_cast.hpp>
1717
#include <boost/any.hpp>
1818
#include <boost/type_traits/is_convertible.hpp>
19+
#include <boost/graph/adjacency_list.hpp>
1920
#include <boost/graph/dll_import_export.hpp>
20-
#include <boost/graph/graphviz.hpp> // for exceptions
21+
#include <boost/graph/exception.hpp>
22+
#include <boost/graph/graph_traits.hpp>
23+
2124
#include <boost/mpl/bool.hpp>
2225
#include <boost/mpl/vector.hpp>
2326
#include <boost/mpl/find.hpp>
2427
#include <boost/mpl/for_each.hpp>
28+
#include <boost/property_map/dynamic_property_map.hpp>
2529
#include <boost/property_tree/detail/xml_parser_utils.hpp>
2630
#include <boost/throw_exception.hpp>
2731
#include <exception>

contrib/restricted/boost/graph/include/boost/graph/graphviz.hpp

Lines changed: 1 addition & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <string>
1919
#include <boost/property_map/property_map.hpp>
2020
#include <boost/tuple/tuple.hpp>
21+
#include <boost/graph/exception.hpp>
2122
#include <boost/graph/graph_traits.hpp>
2223
#include <boost/graph/properties.hpp>
2324
#include <boost/graph/subgraph.hpp>
@@ -649,53 +650,6 @@ void write_graphviz_dp(std::ostream& out, const Graph& g,
649650
/////////////////////////////////////////////////////////////////////////////
650651
// Graph reader exceptions
651652
/////////////////////////////////////////////////////////////////////////////
652-
struct BOOST_SYMBOL_VISIBLE graph_exception : public std::exception
653-
{
654-
~graph_exception() BOOST_OVERRIDE {}
655-
const char* what() const noexcept BOOST_OVERRIDE = 0;
656-
};
657-
658-
struct BOOST_SYMBOL_VISIBLE bad_parallel_edge : public graph_exception
659-
{
660-
std::string from;
661-
std::string to;
662-
mutable std::string statement;
663-
bad_parallel_edge(const std::string& i, const std::string& j)
664-
: from(i), to(j)
665-
{
666-
}
667-
668-
~bad_parallel_edge() BOOST_OVERRIDE {}
669-
const char* what() const noexcept BOOST_OVERRIDE
670-
{
671-
if (statement.empty())
672-
statement = std::string("Failed to add parallel edge: (") + from
673-
+ "," + to + ")\n";
674-
675-
return statement.c_str();
676-
}
677-
};
678-
679-
struct BOOST_SYMBOL_VISIBLE directed_graph_error : public graph_exception
680-
{
681-
~directed_graph_error() BOOST_OVERRIDE {}
682-
const char* what() const noexcept BOOST_OVERRIDE
683-
{
684-
return "read_graphviz: "
685-
"Tried to read a directed graph into an undirected graph.";
686-
}
687-
};
688-
689-
struct BOOST_SYMBOL_VISIBLE undirected_graph_error : public graph_exception
690-
{
691-
~undirected_graph_error() BOOST_OVERRIDE {}
692-
const char* what() const noexcept BOOST_OVERRIDE
693-
{
694-
return "read_graphviz: "
695-
"Tried to read an undirected graph into a directed graph.";
696-
}
697-
};
698-
699653
struct BOOST_SYMBOL_VISIBLE bad_graphviz_syntax : public graph_exception
700654
{
701655
std::string errmsg;

contrib/restricted/boost/graph/include/boost/pending/property.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#ifndef BOOST_PROPERTY_HPP
77
#define BOOST_PROPERTY_HPP
88

9+
#include <boost/config.hpp>
910
#include <boost/mpl/bool.hpp>
1011
#include <boost/mpl/if.hpp>
1112
#include <boost/mpl/has_xxx.hpp>
@@ -30,7 +31,7 @@ template < class Tag, class T, class Base = no_property > struct property
3031
// copy constructor and assignment operator will be generated by compiler
3132

3233
T m_value;
33-
Base m_base;
34+
BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS Base m_base;
3435
};
3536

3637
// Kinds of properties

contrib/restricted/boost/graph/src/read_graphviz_new.cpp

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ namespace boost
5353

5454
namespace read_graphviz_detail
5555
{
56+
static const long max_subgraph_nesting_level = 255;
5657
struct token
5758
{
5859
enum token_type
@@ -207,7 +208,7 @@ namespace read_graphviz_detail
207208

208209
tokenizer(const std::string& str) : begin(str.begin()), end(str.end())
209210
{
210-
std::string end_of_token = "(?=(?:\\W))";
211+
// std::string end_of_token = "(?=(?:\\W))"; // SEHE: unused?
211212
std::string whitespace = "(?:\\s+)";
212213
std::string slash_slash_comment = "(?://.*?$)";
213214
std::string slash_star_comment = "(?:/\\*.*?\\*/)";
@@ -527,6 +528,7 @@ namespace read_graphviz_detail
527528
std::map< subgraph_name, subgraph_info > subgraphs;
528529
std::string current_subgraph_name;
529530
int sgcounter; // Counter for anonymous subgraphs
531+
long sgnesting_level;
530532
std::set< std::pair< node_name, node_name > >
531533
existing_edges; // Used for checking in strict graphs
532534

@@ -538,7 +540,7 @@ namespace read_graphviz_detail
538540
subgraph_member_list& current_members() { return current().members; }
539541

540542
parser(const std::string& gr, parser_result& result)
541-
: the_tokenizer(gr), lookahead(), r(result), sgcounter(0)
543+
: the_tokenizer(gr), lookahead(), r(result), sgcounter(0), sgnesting_level(0)
542544
{
543545
current_subgraph_name = "___root___";
544546
current() = subgraph_info(); // Initialize root graph
@@ -773,10 +775,18 @@ namespace read_graphviz_detail
773775
bool is_anonymous = true;
774776
if (first_token.type == token::kw_subgraph)
775777
{
776-
if (peek().type == token::identifier)
778+
switch (peek().type)
777779
{
780+
case token::identifier:
778781
name = get().normalized_value;
779782
is_anonymous = false;
783+
break;
784+
case token::left_brace:
785+
is_anonymous = true;
786+
break;
787+
default:
788+
error("Subgraph reference needs a name");
789+
break;
780790
}
781791
}
782792
if (is_anonymous)
@@ -790,25 +800,30 @@ namespace read_graphviz_detail
790800
= current(); // Initialize properties and defaults
791801
subgraphs[name].members.clear(); // Except member list
792802
}
793-
if (first_token.type == token::kw_subgraph
794-
&& peek().type != token::left_brace)
803+
if (!is_anonymous && peek().type != token::left_brace)
795804
{
796-
if (is_anonymous)
797-
error("Subgraph reference needs a name");
798805
return name;
799806
}
800807
subgraph_name old_sg = current_subgraph_name;
808+
if (++sgnesting_level > max_subgraph_nesting_level)
809+
{
810+
error("Exceeded maximum subgraph nesting level");
811+
}
801812
current_subgraph_name = name;
802-
if (peek().type == token::left_brace)
803-
get();
804-
else
805-
error("Wanted left brace to start subgraph");
813+
if (first_token.type != token::left_brace)
814+
{
815+
if (peek().type == token::left_brace)
816+
get();
817+
else
818+
error("Wanted left brace to start subgraph");
819+
}
806820
parse_stmt_list();
807821
if (peek().type == token::right_brace)
808822
get();
809823
else
810824
error("Wanted right brace to end subgraph");
811825
current_subgraph_name = old_sg;
826+
sgnesting_level -= 1;
812827
return name;
813828
}
814829

@@ -882,6 +897,7 @@ namespace read_graphviz_detail
882897
"port location");
883898
}
884899
}
900+
break;
885901
default:
886902
break;
887903
}

contrib/restricted/boost/graph/ya.make

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ LICENSE(
1010

1111
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
1212

13-
VERSION(1.85.0)
13+
VERSION(1.86.0)
1414

15-
ORIGINAL_SOURCE(https://github.com/boostorg/graph/archive/boost-1.85.0.tar.gz)
15+
ORIGINAL_SOURCE(https://github.com/boostorg/graph/archive/boost-1.86.0.tar.gz)
1616

1717
PEERDIR(
1818
contrib/restricted/boost/algorithm

0 commit comments

Comments
 (0)