xref: /OK3568_Linux_fs/buildroot/package/odb/0007-Switch-to-C-11-get-rid-of-auto_ptr-use.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593SmuzhiyunFrom c5bea9562929c6b55ca208a530ae80033eeb1614 Mon Sep 17 00:00:00 2001
2*4882a593SmuzhiyunFrom: Boris Kolpackov <boris@codesynthesis.com>
3*4882a593SmuzhiyunDate: Tue, 7 Nov 2017 10:37:53 +0200
4*4882a593SmuzhiyunSubject: [PATCH] Switch to C++11, get rid of auto_ptr use
5*4882a593Smuzhiyun
6*4882a593Smuzhiyun[Upstream: 6e374de9ae2f2978f2fca3390aba4ea3f72bfade]
7*4882a593SmuzhiyunSigned-off-by: Kamel Bouhara <kamel.bouhara@bootlin.com>
8*4882a593Smuzhiyun---
9*4882a593Smuzhiyun odb/Makefile.am   |  5 +++++
10*4882a593Smuzhiyun odb/context.cxx   |  4 ++--
11*4882a593Smuzhiyun odb/context.hxx   |  4 ++--
12*4882a593Smuzhiyun odb/generator.cxx | 18 +++++++++---------
13*4882a593Smuzhiyun odb/options.cli   |  4 ++--
14*4882a593Smuzhiyun odb/parser.cxx    | 14 ++++++++++----
15*4882a593Smuzhiyun odb/parser.hxx    |  7 ++++---
16*4882a593Smuzhiyun odb/plugin.cxx    | 10 +++++-----
17*4882a593Smuzhiyun odb/processor.cxx |  6 +++---
18*4882a593Smuzhiyun odb/validator.cxx |  2 +-
19*4882a593Smuzhiyun 10 files changed, 43 insertions(+), 31 deletions(-)
20*4882a593Smuzhiyun
21*4882a593Smuzhiyundiff --git a/odb/Makefile.am b/odb/Makefile.am
22*4882a593Smuzhiyunindex 2f01398..d9e83d7 100644
23*4882a593Smuzhiyun--- a/odb/Makefile.am
24*4882a593Smuzhiyun+++ b/odb/Makefile.am
25*4882a593Smuzhiyun@@ -9,6 +9,11 @@ plugin_LTLIBRARIES = odb.la
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun AM_CPPFLAGS = -I'$(top_builddir)' -I'$(top_srcdir)'
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun+# Note: not passed by libtool when linking odb.so. Seems to be harmless for
30*4882a593Smuzhiyun+# now.
31*4882a593Smuzhiyun+#
32*4882a593Smuzhiyun+AM_CXXFLAGS = -std=c++0x
33*4882a593Smuzhiyun+
34*4882a593Smuzhiyun EXTRA_DIST = common-query.hxx common.hxx context.hxx context.ixx cxx-lexer.hxx cxx-token.hxx diagnostics.hxx emitter.hxx features.hxx gcc-fwd.hxx gcc.hxx generate.hxx generator.hxx instance.hxx location.hxx lookup.hxx option-functions.hxx option-parsers.hxx option-types.hxx options.hxx options.ixx parser.hxx pragma.hxx processor.hxx profile.hxx relational/common-query.hxx relational/common.hxx relational/common.txx relational/context.hxx relational/context.ixx relational/generate.hxx relational/header.hxx relational/inline.hxx relational/model.hxx relational/mssql/common.hxx relational/mssql/context.hxx relational/mysql/common.hxx relational/mysql/context.hxx relational/oracle/common.hxx relational/oracle/context.hxx relational/pgsql/common.hxx relational/pgsql/context.hxx relational/processor.hxx relational/schema-source.hxx relational/schema.hxx relational/source.hxx relational/sqlite/common.hxx relational/sqlite/context.hxx relational/validator.hxx semantics.hxx semantics/class-template.hxx semantics/class.hxx semantics/derived.hxx semantics/elements.hxx semantics/elements.ixx semantics/enum.hxx semantics/fundamental.hxx semantics/namespace.hxx semantics/relational.hxx semantics/relational/changelog.hxx semantics/relational/changeset.hxx semantics/relational/column.hxx semantics/relational/deferrable.hxx semantics/relational/elements.hxx semantics/relational/elements.txx semantics/relational/foreign-key.hxx semantics/relational/index.hxx semantics/relational/key.hxx semantics/relational/model.hxx semantics/relational/name.hxx semantics/relational/primary-key.hxx semantics/relational/table.hxx semantics/template.hxx semantics/union-template.hxx semantics/union.hxx semantics/unit.hxx sql-lexer.hxx sql-lexer.ixx sql-token.hxx sql-token.ixx traversal.hxx traversal/class-template.hxx traversal/class.hxx traversal/derived.hxx traversal/elements.hxx traversal/enum.hxx traversal/fundamental.hxx traversal/namespace.hxx traversal/relational.hxx traversal/relational/changelog.hxx traversal/relational/changeset.hxx traversal/relational/column.hxx traversal/relational/elements.hxx traversal/relational/foreign-key.hxx traversal/relational/index.hxx traversal/relational/key.hxx traversal/relational/model.hxx traversal/relational/primary-key.hxx traversal/relational/table.hxx traversal/template.hxx traversal/union-template.hxx traversal/union.hxx traversal/unit.hxx validator.hxx version.hxx options.cli
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun # Plugin.
37*4882a593Smuzhiyundiff --git a/odb/context.cxx b/odb/context.cxx
38*4882a593Smuzhiyunindex d62fa88..87f1c32 100644
39*4882a593Smuzhiyun--- a/odb/context.cxx
40*4882a593Smuzhiyun+++ b/odb/context.cxx
41*4882a593Smuzhiyun@@ -564,14 +564,14 @@ namespace
42*4882a593Smuzhiyun   };
43*4882a593Smuzhiyun }
44*4882a593Smuzhiyun
45*4882a593Smuzhiyun-auto_ptr<context>
46*4882a593Smuzhiyun+unique_ptr<context>
47*4882a593Smuzhiyun create_context (ostream& os,
48*4882a593Smuzhiyun                 semantics::unit& unit,
49*4882a593Smuzhiyun                 options const& ops,
50*4882a593Smuzhiyun                 features& f,
51*4882a593Smuzhiyun                 semantics::relational::model* m)
52*4882a593Smuzhiyun {
53*4882a593Smuzhiyun-  auto_ptr<context> r;
54*4882a593Smuzhiyun+  unique_ptr<context> r;
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun   switch (ops.database ()[0])
57*4882a593Smuzhiyun   {
58*4882a593Smuzhiyundiff --git a/odb/context.hxx b/odb/context.hxx
59*4882a593Smuzhiyunindex 351bc61..10de237 100644
60*4882a593Smuzhiyun--- a/odb/context.hxx
61*4882a593Smuzhiyun+++ b/odb/context.hxx
62*4882a593Smuzhiyun@@ -13,7 +13,7 @@
63*4882a593Smuzhiyun #include <stack>
64*4882a593Smuzhiyun #include <vector>
65*4882a593Smuzhiyun #include <string>
66*4882a593Smuzhiyun-#include <memory>  // std::auto_ptr
67*4882a593Smuzhiyun+#include <memory>  // std::unique_ptr
68*4882a593Smuzhiyun #include <ostream>
69*4882a593Smuzhiyun #include <cstddef> // std::size_t
70*4882a593Smuzhiyun #include <iostream>
71*4882a593Smuzhiyun@@ -1691,7 +1691,7 @@ private:
72*4882a593Smuzhiyun
73*4882a593Smuzhiyun // Create concrete database context.
74*4882a593Smuzhiyun //
75*4882a593Smuzhiyun-std::auto_ptr<context>
76*4882a593Smuzhiyun+std::unique_ptr<context>
77*4882a593Smuzhiyun create_context (std::ostream&,
78*4882a593Smuzhiyun                 semantics::unit&,
79*4882a593Smuzhiyun                 options const&,
80*4882a593Smuzhiyundiff --git a/odb/generator.cxx b/odb/generator.cxx
81*4882a593Smuzhiyunindex 6aa5151..266b75f 100644
82*4882a593Smuzhiyun--- a/odb/generator.cxx
83*4882a593Smuzhiyun+++ b/odb/generator.cxx
84*4882a593Smuzhiyun@@ -4,7 +4,7 @@
85*4882a593Smuzhiyun
86*4882a593Smuzhiyun #include <cctype>  // std::toupper, std::is{alpha,upper,lower}
87*4882a593Smuzhiyun #include <string>
88*4882a593Smuzhiyun-#include <memory>  // std::auto_ptr
89*4882a593Smuzhiyun+#include <memory>  // std::unique_ptr
90*4882a593Smuzhiyun #include <iomanip>
91*4882a593Smuzhiyun #include <fstream>
92*4882a593Smuzhiyun #include <sstream>
93*4882a593Smuzhiyun@@ -141,7 +141,7 @@ generate (options const& ops,
94*4882a593Smuzhiyun
95*4882a593Smuzhiyun     if (gen_schema)
96*4882a593Smuzhiyun     {
97*4882a593Smuzhiyun-      auto_ptr<context> ctx (create_context (cerr, unit, ops, fts, 0));
98*4882a593Smuzhiyun+      unique_ptr<context> ctx (create_context (cerr, unit, ops, fts, 0));
99*4882a593Smuzhiyun
100*4882a593Smuzhiyun       switch (db)
101*4882a593Smuzhiyun       {
102*4882a593Smuzhiyun@@ -471,7 +471,7 @@ generate (options const& ops,
103*4882a593Smuzhiyun     //
104*4882a593Smuzhiyun     if (gen_cxx)
105*4882a593Smuzhiyun     {
106*4882a593Smuzhiyun-      auto_ptr<context> ctx (
107*4882a593Smuzhiyun+      unique_ptr<context> ctx (
108*4882a593Smuzhiyun         create_context (hxx, unit, ops, fts, model.get ()));
109*4882a593Smuzhiyun
110*4882a593Smuzhiyun       sloc_filter sloc (ctx->os);
111*4882a593Smuzhiyun@@ -581,7 +581,7 @@ generate (options const& ops,
112*4882a593Smuzhiyun     //
113*4882a593Smuzhiyun     if (gen_cxx)
114*4882a593Smuzhiyun     {
115*4882a593Smuzhiyun-      auto_ptr<context> ctx (
116*4882a593Smuzhiyun+      unique_ptr<context> ctx (
117*4882a593Smuzhiyun         create_context (ixx, unit, ops, fts, model.get ()));
118*4882a593Smuzhiyun
119*4882a593Smuzhiyun       sloc_filter sloc (ctx->os);
120*4882a593Smuzhiyun@@ -641,7 +641,7 @@ generate (options const& ops,
121*4882a593Smuzhiyun     //
122*4882a593Smuzhiyun     if (gen_cxx && (db != database::common || md == multi_database::dynamic))
123*4882a593Smuzhiyun     {
124*4882a593Smuzhiyun-      auto_ptr<context> ctx (
125*4882a593Smuzhiyun+      unique_ptr<context> ctx (
126*4882a593Smuzhiyun         create_context (cxx, unit, ops, fts, model.get ()));
127*4882a593Smuzhiyun
128*4882a593Smuzhiyun       sloc_filter sloc (ctx->os);
129*4882a593Smuzhiyun@@ -734,7 +734,7 @@ generate (options const& ops,
130*4882a593Smuzhiyun     //
131*4882a593Smuzhiyun     if (gen_sep_schema)
132*4882a593Smuzhiyun     {
133*4882a593Smuzhiyun-      auto_ptr<context> ctx (
134*4882a593Smuzhiyun+      unique_ptr<context> ctx (
135*4882a593Smuzhiyun         create_context (sch, unit, ops, fts, model.get ()));
136*4882a593Smuzhiyun
137*4882a593Smuzhiyun       sloc_filter sloc (ctx->os);
138*4882a593Smuzhiyun@@ -799,7 +799,7 @@ generate (options const& ops,
139*4882a593Smuzhiyun     //
140*4882a593Smuzhiyun     if (gen_sql_schema)
141*4882a593Smuzhiyun     {
142*4882a593Smuzhiyun-      auto_ptr<context> ctx (
143*4882a593Smuzhiyun+      unique_ptr<context> ctx (
144*4882a593Smuzhiyun         create_context (sql, unit, ops, fts, model.get ()));
145*4882a593Smuzhiyun
146*4882a593Smuzhiyun       switch (db)
147*4882a593Smuzhiyun@@ -865,7 +865,7 @@ generate (options const& ops,
148*4882a593Smuzhiyun         //
149*4882a593Smuzhiyun         {
150*4882a593Smuzhiyun           ofstream& mig (*mig_pre[i]);
151*4882a593Smuzhiyun-          auto_ptr<context> ctx (create_context (mig, unit, ops, fts, 0));
152*4882a593Smuzhiyun+          unique_ptr<context> ctx (create_context (mig, unit, ops, fts, 0));
153*4882a593Smuzhiyun
154*4882a593Smuzhiyun           switch (db)
155*4882a593Smuzhiyun           {
156*4882a593Smuzhiyun@@ -908,7 +908,7 @@ generate (options const& ops,
157*4882a593Smuzhiyun         //
158*4882a593Smuzhiyun         {
159*4882a593Smuzhiyun           ofstream& mig (*mig_post[i]);
160*4882a593Smuzhiyun-          auto_ptr<context> ctx (create_context (mig, unit, ops, fts, 0));
161*4882a593Smuzhiyun+          unique_ptr<context> ctx (create_context (mig, unit, ops, fts, 0));
162*4882a593Smuzhiyun
163*4882a593Smuzhiyun           switch (db)
164*4882a593Smuzhiyun           {
165*4882a593Smuzhiyundiff --git a/odb/options.cli b/odb/options.cli
166*4882a593Smuzhiyunindex cf278cb..c994975 100644
167*4882a593Smuzhiyun--- a/odb/options.cli
168*4882a593Smuzhiyun+++ b/odb/options.cli
169*4882a593Smuzhiyun@@ -211,10 +211,10 @@ class options
170*4882a593Smuzhiyun      \cb{db pointer} pragma will use this pointer by default. The value
171*4882a593Smuzhiyun      of this option can be \cb{*} which denotes the raw pointer and is
172*4882a593Smuzhiyun      the default, or qualified name of a smart pointer class template,
173*4882a593Smuzhiyun-     for example, \cb{std::auto_ptr}. In the latter case, the ODB compiler
174*4882a593Smuzhiyun+     for example, \cb{std::shared_ptr}. In the latter case, the ODB compiler
175*4882a593Smuzhiyun      constructs the object or view pointer by adding a single template
176*4882a593Smuzhiyun      argument of the object or view type to the qualified name, for example
177*4882a593Smuzhiyun-     \cb{std::auto_ptr<object>}. The ODB runtime uses object and view
178*4882a593Smuzhiyun+     \cb{std::shared_ptr<object>}. The ODB runtime uses object and view
179*4882a593Smuzhiyun      pointers to return, and, in case of objects, pass and cache
180*4882a593Smuzhiyun      dynamically allocated instances of object and view types.
181*4882a593Smuzhiyun
182*4882a593Smuzhiyundiff --git a/odb/parser.cxx b/odb/parser.cxx
183*4882a593Smuzhiyunindex 927063b..30e45af 100644
184*4882a593Smuzhiyun--- a/odb/parser.cxx
185*4882a593Smuzhiyun+++ b/odb/parser.cxx
186*4882a593Smuzhiyun@@ -26,7 +26,7 @@ public:
187*4882a593Smuzhiyun
188*4882a593Smuzhiyun   impl (options const&, loc_pragmas&, ns_loc_pragmas&, decl_pragmas&);
189*4882a593Smuzhiyun
190*4882a593Smuzhiyun-  auto_ptr<unit>
191*4882a593Smuzhiyun+  unique_ptr<unit>
192*4882a593Smuzhiyun   parse (tree global_scope, path const& main_file);
193*4882a593Smuzhiyun
194*4882a593Smuzhiyun private:
195*4882a593Smuzhiyun@@ -728,10 +728,10 @@ impl (options const& ops,
196*4882a593Smuzhiyun {
197*4882a593Smuzhiyun }
198*4882a593Smuzhiyun
199*4882a593Smuzhiyun-auto_ptr<unit> parser::impl::
200*4882a593Smuzhiyun+unique_ptr<unit> parser::impl::
201*4882a593Smuzhiyun parse (tree global_scope, path const& main_file)
202*4882a593Smuzhiyun {
203*4882a593Smuzhiyun-  auto_ptr<unit> u (new unit (main_file));
204*4882a593Smuzhiyun+  unique_ptr<unit> u (new unit (main_file));
205*4882a593Smuzhiyun   u->insert (global_namespace, *u);
206*4882a593Smuzhiyun   process_named_pragmas (global_namespace, *u);
207*4882a593Smuzhiyun
208*4882a593Smuzhiyun@@ -2263,6 +2263,12 @@ fq_scope (tree decl)
209*4882a593Smuzhiyun // parser
210*4882a593Smuzhiyun //
211*4882a593Smuzhiyun
212*4882a593Smuzhiyun+parser::
213*4882a593Smuzhiyun+~parser ()
214*4882a593Smuzhiyun+{
215*4882a593Smuzhiyun+  // Needs parser::impl definition.
216*4882a593Smuzhiyun+}
217*4882a593Smuzhiyun+
218*4882a593Smuzhiyun parser::
219*4882a593Smuzhiyun parser (options const& ops,
220*4882a593Smuzhiyun         loc_pragmas& lp,
221*4882a593Smuzhiyun@@ -2272,7 +2278,7 @@ parser (options const& ops,
222*4882a593Smuzhiyun {
223*4882a593Smuzhiyun }
224*4882a593Smuzhiyun
225*4882a593Smuzhiyun-auto_ptr<unit> parser::
226*4882a593Smuzhiyun+unique_ptr<unit> parser::
227*4882a593Smuzhiyun parse (tree global_scope, path const& main_file)
228*4882a593Smuzhiyun {
229*4882a593Smuzhiyun   return impl_->parse (global_scope, main_file);
230*4882a593Smuzhiyundiff --git a/odb/parser.hxx b/odb/parser.hxx
231*4882a593Smuzhiyunindex 80e4aa4..648337f 100644
232*4882a593Smuzhiyun--- a/odb/parser.hxx
233*4882a593Smuzhiyun+++ b/odb/parser.hxx
234*4882a593Smuzhiyun@@ -7,7 +7,7 @@
235*4882a593Smuzhiyun
236*4882a593Smuzhiyun #include <odb/gcc.hxx>
237*4882a593Smuzhiyun
238*4882a593Smuzhiyun-#include <memory>  // std::auto_ptr
239*4882a593Smuzhiyun+#include <memory>  // std::unique_ptr
240*4882a593Smuzhiyun
241*4882a593Smuzhiyun #include <odb/pragma.hxx>
242*4882a593Smuzhiyun #include <odb/options.hxx>
243*4882a593Smuzhiyun@@ -18,9 +18,10 @@ class parser
244*4882a593Smuzhiyun public:
245*4882a593Smuzhiyun   class failed {};
246*4882a593Smuzhiyun
247*4882a593Smuzhiyun+  ~parser ();
248*4882a593Smuzhiyun   parser (options const&, loc_pragmas&, ns_loc_pragmas&, decl_pragmas&);
249*4882a593Smuzhiyun
250*4882a593Smuzhiyun-  std::auto_ptr<semantics::unit>
251*4882a593Smuzhiyun+  std::unique_ptr<semantics::unit>
252*4882a593Smuzhiyun   parse (tree global_scope, semantics::path const& main_file);
253*4882a593Smuzhiyun
254*4882a593Smuzhiyun private:
255*4882a593Smuzhiyun@@ -31,7 +32,7 @@ private:
256*4882a593Smuzhiyun
257*4882a593Smuzhiyun private:
258*4882a593Smuzhiyun   class impl;
259*4882a593Smuzhiyun-  std::auto_ptr<impl> impl_;
260*4882a593Smuzhiyun+  std::unique_ptr<impl> impl_;
261*4882a593Smuzhiyun };
262*4882a593Smuzhiyun
263*4882a593Smuzhiyun #endif // ODB_PARSER_HXX
264*4882a593Smuzhiyundiff --git a/odb/plugin.cxx b/odb/plugin.cxx
265*4882a593Smuzhiyunindex 779faed..0fac632 100644
266*4882a593Smuzhiyun--- a/odb/plugin.cxx
267*4882a593Smuzhiyun+++ b/odb/plugin.cxx
268*4882a593Smuzhiyun@@ -8,7 +8,7 @@
269*4882a593Smuzhiyun #include <sys/types.h> // stat
270*4882a593Smuzhiyun #include <sys/stat.h>  // stat
271*4882a593Smuzhiyun
272*4882a593Smuzhiyun-#include <memory>  // std::auto_ptr
273*4882a593Smuzhiyun+#include <memory>  // std::unique_ptr
274*4882a593Smuzhiyun #include <string>
275*4882a593Smuzhiyun #include <vector>
276*4882a593Smuzhiyun #include <cstring> // std::strcpy, std::strstr
277*4882a593Smuzhiyun@@ -39,7 +39,7 @@ using cutl::fs::invalid_path;
278*4882a593Smuzhiyun typedef vector<path> paths;
279*4882a593Smuzhiyun
280*4882a593Smuzhiyun int plugin_is_GPL_compatible;
281*4882a593Smuzhiyun-auto_ptr<options const> options_;
282*4882a593Smuzhiyun+unique_ptr<options const> options_;
283*4882a593Smuzhiyun paths profile_paths_;
284*4882a593Smuzhiyun path file_;    // File being compiled.
285*4882a593Smuzhiyun paths inputs_; // List of input files in at-once mode or just file_.
286*4882a593Smuzhiyun@@ -222,7 +222,7 @@ gate_callback (void*, void*)
287*4882a593Smuzhiyun     // Parse the GCC tree to semantic graph.
288*4882a593Smuzhiyun     //
289*4882a593Smuzhiyun     parser p (*options_, loc_pragmas_, ns_loc_pragmas_, decl_pragmas_);
290*4882a593Smuzhiyun-    auto_ptr<unit> u (p.parse (global_namespace, file_));
291*4882a593Smuzhiyun+    unique_ptr<unit> u (p.parse (global_namespace, file_));
292*4882a593Smuzhiyun
293*4882a593Smuzhiyun     features f;
294*4882a593Smuzhiyun
295*4882a593Smuzhiyun@@ -377,14 +377,14 @@ plugin_init (plugin_name_args* plugin_info, plugin_gcc_version*)
296*4882a593Smuzhiyun       oi[2].arg = &pd;
297*4882a593Smuzhiyun
298*4882a593Smuzhiyun       cli::argv_file_scanner scan (argc, &argv[0], oi, 3);
299*4882a593Smuzhiyun-      auto_ptr<options> ops (
300*4882a593Smuzhiyun+      unique_ptr<options> ops (
301*4882a593Smuzhiyun         new options (scan, cli::unknown_mode::fail, cli::unknown_mode::fail));
302*4882a593Smuzhiyun
303*4882a593Smuzhiyun       // Process options.
304*4882a593Smuzhiyun       //
305*4882a593Smuzhiyun       process_options (*ops);
306*4882a593Smuzhiyun
307*4882a593Smuzhiyun-      options_ = ops;
308*4882a593Smuzhiyun+      options_ = move (ops);
309*4882a593Smuzhiyun       pragma_db_ = db;
310*4882a593Smuzhiyun       pragma_multi_ = options_->multi_database ();
311*4882a593Smuzhiyun     }
312*4882a593Smuzhiyundiff --git a/odb/processor.cxx b/odb/processor.cxx
313*4882a593Smuzhiyunindex bea3624..c787e0d 100644
314*4882a593Smuzhiyun--- a/odb/processor.cxx
315*4882a593Smuzhiyun+++ b/odb/processor.cxx
316*4882a593Smuzhiyun@@ -120,8 +120,8 @@ namespace
317*4882a593Smuzhiyun       // both the wrapper type and the wrapped type must be const.
318*4882a593Smuzhiyun       // To see why, consider these possibilities:
319*4882a593Smuzhiyun       //
320*4882a593Smuzhiyun-      // auto_ptr<const T> - can modify by setting a new pointer
321*4882a593Smuzhiyun-      // const auto_ptr<T> - can modify by changing the pointed-to value
322*4882a593Smuzhiyun+      // unique_ptr<const T> - can modify by setting a new pointer
323*4882a593Smuzhiyun+      // const unique_ptr<T> - can modify by changing the pointed-to value
324*4882a593Smuzhiyun       //
325*4882a593Smuzhiyun       if (const_type (m.type ()) &&
326*4882a593Smuzhiyun           !(id (m) || version (m) || m.count ("inverse")))
327*4882a593Smuzhiyun@@ -3086,7 +3086,7 @@ process (options const& ops,
328*4882a593Smuzhiyun {
329*4882a593Smuzhiyun   try
330*4882a593Smuzhiyun   {
331*4882a593Smuzhiyun-    auto_ptr<context> ctx (create_context (cerr, unit, ops, f, 0));
332*4882a593Smuzhiyun+    unique_ptr<context> ctx (create_context (cerr, unit, ops, f, 0));
333*4882a593Smuzhiyun
334*4882a593Smuzhiyun     // Common processing.
335*4882a593Smuzhiyun     //
336*4882a593Smuzhiyundiff --git a/odb/validator.cxx b/odb/validator.cxx
337*4882a593Smuzhiyunindex aac52e4..196386c 100644
338*4882a593Smuzhiyun--- a/odb/validator.cxx
339*4882a593Smuzhiyun+++ b/odb/validator.cxx
340*4882a593Smuzhiyun@@ -1516,7 +1516,7 @@ validate (options const& ops,
341*4882a593Smuzhiyun   if (!valid)
342*4882a593Smuzhiyun     throw validator_failed ();
343*4882a593Smuzhiyun
344*4882a593Smuzhiyun-  auto_ptr<context> ctx (create_context (cerr, u, ops, f, 0));
345*4882a593Smuzhiyun+  unique_ptr<context> ctx (create_context (cerr, u, ops, f, 0));
346*4882a593Smuzhiyun
347*4882a593Smuzhiyun   if (pass == 1)
348*4882a593Smuzhiyun   {
349*4882a593Smuzhiyun--
350*4882a593Smuzhiyun2.25.0
351*4882a593Smuzhiyun
352