aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildfile2
-rw-r--r--manifest10
-rw-r--r--odb/buildfile10
-rw-r--r--odb/gcc.hxx7
-rw-r--r--odb/odb.cxx36
-rw-r--r--odb/options.cli3
-rw-r--r--odb/options.cxx287
-rw-r--r--odb/options.hxx19
-rw-r--r--odb/options.ixx30
-rw-r--r--odb/parser.cxx20
-rw-r--r--odb/semantics/class.cxx36
-rw-r--r--odb/semantics/elements.cxx4
-rw-r--r--odb/validator.cxx3
-rw-r--r--odb/version.hxx11
-rw-r--r--tests/build/root.build5
-rw-r--r--version2
16 files changed, 322 insertions, 163 deletions
diff --git a/buildfile b/buildfile
index f656924..78b5d08 100644
--- a/buildfile
+++ b/buildfile
@@ -1,7 +1,7 @@
# file : buildfile
# license : GNU GPL v3; see accompanying LICENSE file
-./: {*/ -build/ -m4/} doc{GPLv3 INSTALL LICENSE NEWS README} manifest
+./: {*/ -build/ -m4/} doc{INSTALL NEWS README} legal{GPLv3 LICENSE} manifest
# Don't install tests or the INSTALL file.
#
diff --git a/manifest b/manifest
index 42f3b2e..e289c3f 100644
--- a/manifest
+++ b/manifest
@@ -1,8 +1,8 @@
: 1
name: odb
-version: 2.5.0-b.18.z
+version: 2.5.0-b.20.z
summary: ODB compiler
-license: GPLv3
+license: GPL-3.0-only
topics: C++, ORM, source code generation, object persistence, \
relational database
description-file: README
@@ -11,14 +11,14 @@ url: https://www.codesynthesis.com/products/odb/
doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml
src-url: https://git.codesynthesis.com/cgit/odb/odb/
email: odb-users@codesynthesis.com
-build-email: odb-builds@codesynthesis.com
+build-warning-email: odb-builds@codesynthesis.com
builds: all
builds: -( +windows -gcc ) ; Requires MinGW GCC.
builds: &gcc ; Requires GCC with plugin support enabled.
builds: &gcc-5+ ; Requires GCC 5 or later.
builds: -static ; Implementation uses plugins and requires -fPIC.
requires: c++11
-depends: * build2 >= 0.12.0
-depends: * bpkg >= 0.12.0
+depends: * build2 >= 0.13.0
+depends: * bpkg >= 0.13.0
depends: libstudxml ^1.1.0-
depends: libcutl ^1.11.0-
diff --git a/odb/buildfile b/odb/buildfile
index 8c8d458..8e931ad 100644
--- a/odb/buildfile
+++ b/odb/buildfile
@@ -65,6 +65,16 @@ exe{odb}: cxx{odb}
exe{odb}: libus{odb}: bin.whole = false
exe{odb}: plugin{odb}: include = adhoc
+# Target metadata, see also --build2-metadata in odb.cxx.
+#
+exe{odb}:
+{
+ export.metadata = 1 odb
+ odb.name = [string] odb
+ odb.version = $version
+ odb.checksum = $version
+}
+
plugin{odb}: libus{odb}
switch $cxx.target.system
diff --git a/odb/gcc.hxx b/odb/gcc.hxx
index 9b644d7..af0e2a0 100644
--- a/odb/gcc.hxx
+++ b/odb/gcc.hxx
@@ -151,10 +151,13 @@ gcc_tree_code_name (gcc_tree_code_type tc) {return tree_code_name[tc];}
#define DECL_CHAIN(x) TREE_CHAIN(x)
#endif
-// In GCC 6, ANON_AGGRNAME_P became anon_aggrname_p().
+// In GCC 6 ANON_AGGRNAME_P became anon_aggrname_p().
+// In GCC 10 anon_aggrname_p() became IDENTIFIER_ANON_P.
//
#if BUILDING_GCC_MAJOR < 6
-# define anon_aggrname_p(X) ANON_AGGRNAME_P(X)
+# define IDENTIFIER_ANON_P(X) ANON_AGGRNAME_P(X)
+#elif BUILDING_GCC_MAJOR < 10
+# define IDENTIFIER_ANON_P(X) anon_aggrname_p(X)
#endif
// In GCC 9:
diff --git a/odb/odb.cxx b/odb/odb.cxx
index 5381668..225cc21 100644
--- a/odb/odb.cxx
+++ b/odb/odb.cxx
@@ -592,20 +592,40 @@ main (int argc, char* argv[])
cli::argv_file_scanner scan (ac, &av[0], oi, 3);
options ops (scan);
+ // Handle --build2-metadata (see also buildfile).
+ //
+ if (ops.build2_metadata_specified ())
+ {
+ ostream& o (cout);
+
+ // Note that the export.metadata variable should be the first non-
+ // blank/comment line.
+ //
+ o << "# build2 buildfile odb" << endl
+ << "export.metadata = 1 odb" << endl
+ << "odb.name = [string] odb" << endl
+ << "odb.version = [string] '" << ODB_COMPILER_VERSION_STR << '\'' << endl
+ << "odb.checksum = [string] '" << ODB_COMPILER_VERSION_STR << '\'' << endl;
+
+ return 0;
+ }
+
// Handle --version.
//
if (ops.version ())
{
- cout << "ODB object-relational mapping (ORM) compiler for C++ "
+ ostream& o (cout);
+
+ o << "ODB object-relational mapping (ORM) compiler for C++ "
ODB_COMPILER_VERSION_STR << endl;
#ifdef ODB_BUILD2
- cout << "Copyright (c) " << ODB_COPYRIGHT << "." << endl;
+ o << "Copyright (c) " << ODB_COPYRIGHT << "." << endl;
#endif
- cout << "This is free software; see the source for copying "
- << "conditions. There is NO\nwarranty; not even for "
- << "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." << endl;
+ o << "This is free software; see the source for copying conditions. "
+ << "There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS "
+ << "FOR A PARTICULAR PURPOSE." << endl;
return 0;
}
@@ -614,8 +634,10 @@ main (int argc, char* argv[])
//
if (ops.help ())
{
- cout << "Usage: " << argv[0] << " [options] file [file ...]" << endl
- << "Options:" << endl;
+ ostream& o (cout);
+
+ o << "Usage: " << argv[0] << " [options] file [file ...]" << endl
+ << "Options:" << endl;
options::print_usage (cout);
return 0;
diff --git a/odb/options.cli b/odb/options.cli
index e202159..bb8797b 100644
--- a/odb/options.cli
+++ b/odb/options.cli
@@ -5,6 +5,7 @@ include <set>;
include <vector>;
include <string>;
include <cstddef>;
+include <cstdint>;
include <odb/option-types.hxx>;
@@ -14,6 +15,8 @@ class options
// Wrapper options. These are not passed to the plugin.
//
+ std::uint64_t --build2-metadata; // Leave undocumented/hidden.
+
bool --help {"Print usage information and exit."};
bool --version {"Print version and exit."};
diff --git a/odb/options.cxx b/odb/options.cxx
index fedf8c5..ec6cd7f 100644
--- a/odb/options.cxx
+++ b/odb/options.cxx
@@ -589,9 +589,10 @@ namespace cli
std::string vstr (ov, (p != std::string::npos ? p + 1 : ov.size ()));
int ac (2);
- char* av[] =
+ char* av[] =
{
- const_cast<char*> (o), 0
+ const_cast<char*> (o),
+ 0
};
bool dummy;
@@ -641,7 +642,9 @@ namespace cli
options::
options ()
-: help_ (),
+: build2_metadata_ (),
+ build2_metadata_specified_ (false),
+ help_ (),
version_ (),
I_ (),
I_specified_ (false),
@@ -852,7 +855,9 @@ options (int& argc,
bool erase,
::cli::unknown_mode opt,
::cli::unknown_mode arg)
-: help_ (),
+: build2_metadata_ (),
+ build2_metadata_specified_ (false),
+ help_ (),
version_ (),
I_ (),
I_specified_ (false),
@@ -1066,7 +1071,9 @@ options (int start,
bool erase,
::cli::unknown_mode opt,
::cli::unknown_mode arg)
-: help_ (),
+: build2_metadata_ (),
+ build2_metadata_specified_ (false),
+ help_ (),
version_ (),
I_ (),
I_specified_ (false),
@@ -1280,7 +1287,9 @@ options (int& argc,
bool erase,
::cli::unknown_mode opt,
::cli::unknown_mode arg)
-: help_ (),
+: build2_metadata_ (),
+ build2_metadata_specified_ (false),
+ help_ (),
version_ (),
I_ (),
I_specified_ (false),
@@ -1496,7 +1505,9 @@ options (int start,
bool erase,
::cli::unknown_mode opt,
::cli::unknown_mode arg)
-: help_ (),
+: build2_metadata_ (),
+ build2_metadata_specified_ (false),
+ help_ (),
version_ (),
I_ (),
I_specified_ (false),
@@ -1708,7 +1719,9 @@ options::
options (::cli::scanner& s,
::cli::unknown_mode opt,
::cli::unknown_mode arg)
-: help_ (),
+: build2_metadata_ (),
+ build2_metadata_specified_ (false),
+ help_ (),
version_ (),
I_ (),
I_specified_ (false),
@@ -2296,6 +2309,15 @@ static _cli_options_desc_type _cli_options_desc_;
void options::
fill (::cli::options& os)
{
+ // --build2-metadata
+ //
+ {
+ ::cli::option_names a;
+ std::string dv;
+ ::cli::option o ("--build2-metadata", a, false, dv);
+ os.push_back (o);
+ }
+
// --help
//
{
@@ -3355,339 +3377,342 @@ struct _cli_options_map_init
{
_cli_options_map_init ()
{
- _cli_options_map_["--help"] =
+ _cli_options_map_["--build2-metadata"] =
+ &::cli::thunk< options, std::uint64_t, &options::build2_metadata_,
+ &options::build2_metadata_specified_ >;
+ _cli_options_map_["--help"] =
&::cli::thunk< options, bool, &options::help_ >;
- _cli_options_map_["--version"] =
+ _cli_options_map_["--version"] =
&::cli::thunk< options, bool, &options::version_ >;
- _cli_options_map_["-I"] =
+ _cli_options_map_["-I"] =
&::cli::thunk< options, std::vector<std::string>, &options::I_,
&options::I_specified_ >;
- _cli_options_map_["-D"] =
+ _cli_options_map_["-D"] =
&::cli::thunk< options, std::vector<std::string>, &options::D_,
&options::D_specified_ >;
- _cli_options_map_["-U"] =
+ _cli_options_map_["-U"] =
&::cli::thunk< options, std::vector<std::string>, &options::U_,
&options::U_specified_ >;
- _cli_options_map_["--database"] =
+ _cli_options_map_["--database"] =
&::cli::thunk< options, std::vector< ::database>, &options::database_,
&options::database_specified_ >;
- _cli_options_map_["-d"] =
+ _cli_options_map_["-d"] =
&::cli::thunk< options, std::vector< ::database>, &options::database_,
&options::database_specified_ >;
- _cli_options_map_["--multi-database"] =
+ _cli_options_map_["--multi-database"] =
&::cli::thunk< options, ::multi_database, &options::multi_database_,
&options::multi_database_specified_ >;
- _cli_options_map_["-m"] =
+ _cli_options_map_["-m"] =
&::cli::thunk< options, ::multi_database, &options::multi_database_,
&options::multi_database_specified_ >;
- _cli_options_map_["--default-database"] =
+ _cli_options_map_["--default-database"] =
&::cli::thunk< options, ::database, &options::default_database_,
&options::default_database_specified_ >;
- _cli_options_map_["--generate-query"] =
+ _cli_options_map_["--generate-query"] =
&::cli::thunk< options, bool, &options::generate_query_ >;
- _cli_options_map_["-q"] =
+ _cli_options_map_["-q"] =
&::cli::thunk< options, bool, &options::generate_query_ >;
- _cli_options_map_["--generate-prepared"] =
+ _cli_options_map_["--generate-prepared"] =
&::cli::thunk< options, bool, &options::generate_prepared_ >;
- _cli_options_map_["--omit-unprepared"] =
+ _cli_options_map_["--omit-unprepared"] =
&::cli::thunk< options, bool, &options::omit_unprepared_ >;
- _cli_options_map_["--generate-session"] =
+ _cli_options_map_["--generate-session"] =
&::cli::thunk< options, bool, &options::generate_session_ >;
- _cli_options_map_["-e"] =
+ _cli_options_map_["-e"] =
&::cli::thunk< options, bool, &options::generate_session_ >;
- _cli_options_map_["--generate-schema"] =
+ _cli_options_map_["--generate-schema"] =
&::cli::thunk< options, bool, &options::generate_schema_ >;
- _cli_options_map_["-s"] =
+ _cli_options_map_["-s"] =
&::cli::thunk< options, bool, &options::generate_schema_ >;
- _cli_options_map_["--generate-schema-only"] =
+ _cli_options_map_["--generate-schema-only"] =
&::cli::thunk< options, bool, &options::generate_schema_only_ >;
- _cli_options_map_["--suppress-migration"] =
+ _cli_options_map_["--suppress-migration"] =
&::cli::thunk< options, bool, &options::suppress_migration_ >;
- _cli_options_map_["--suppress-schema-version"] =
+ _cli_options_map_["--suppress-schema-version"] =
&::cli::thunk< options, bool, &options::suppress_schema_version_ >;
- _cli_options_map_["--schema-version-table"] =
+ _cli_options_map_["--schema-version-table"] =
&::cli::thunk< options, database_map<qname>, &options::schema_version_table_,
&options::schema_version_table_specified_ >;
- _cli_options_map_["--schema-format"] =
+ _cli_options_map_["--schema-format"] =
&::cli::thunk< options, database_map<std::set< ::schema_format> >, &options::schema_format_,
&options::schema_format_specified_ >;
- _cli_options_map_["--omit-drop"] =
+ _cli_options_map_["--omit-drop"] =
&::cli::thunk< options, bool, &options::omit_drop_ >;
- _cli_options_map_["--omit-create"] =
+ _cli_options_map_["--omit-create"] =
&::cli::thunk< options, bool, &options::omit_create_ >;
- _cli_options_map_["--schema-name"] =
+ _cli_options_map_["--schema-name"] =
&::cli::thunk< options, database_map<std::string>, &options::schema_name_,
&options::schema_name_specified_ >;
- _cli_options_map_["--fkeys-deferrable-mode"] =
+ _cli_options_map_["--fkeys-deferrable-mode"] =
&::cli::thunk< options, database_map<deferrable>, &options::fkeys_deferrable_mode_,
&options::fkeys_deferrable_mode_specified_ >;
- _cli_options_map_["--default-pointer"] =
+ _cli_options_map_["--default-pointer"] =
&::cli::thunk< options, std::string, &options::default_pointer_,
&options::default_pointer_specified_ >;
- _cli_options_map_["--session-type"] =
+ _cli_options_map_["--session-type"] =
&::cli::thunk< options, std::string, &options::session_type_,
&options::session_type_specified_ >;
- _cli_options_map_["--profile"] =
+ _cli_options_map_["--profile"] =
&::cli::thunk< options, std::string, &options::profile_,
&options::profile_specified_ >;
- _cli_options_map_["-p"] =
+ _cli_options_map_["-p"] =
&::cli::thunk< options, std::string, &options::profile_,
&options::profile_specified_ >;
- _cli_options_map_["--at-once"] =
+ _cli_options_map_["--at-once"] =
&::cli::thunk< options, bool, &options::at_once_ >;
- _cli_options_map_["--schema"] =
+ _cli_options_map_["--schema"] =
&::cli::thunk< options, database_map<qname>, &options::schema_,
&options::schema_specified_ >;
- _cli_options_map_["--export-symbol"] =
+ _cli_options_map_["--export-symbol"] =
&::cli::thunk< options, database_map<std::string>, &options::export_symbol_,
&options::export_symbol_specified_ >;
- _cli_options_map_["--extern-symbol"] =
+ _cli_options_map_["--extern-symbol"] =
&::cli::thunk< options, database_map<std::string>, &options::extern_symbol_,
&options::extern_symbol_specified_ >;
- _cli_options_map_["--std"] =
+ _cli_options_map_["--std"] =
&::cli::thunk< options, cxx_version, &options::std_,
&options::std_specified_ >;
- _cli_options_map_["--warn-hard-add"] =
+ _cli_options_map_["--warn-hard-add"] =
&::cli::thunk< options, bool, &options::warn_hard_add_ >;
- _cli_options_map_["--warn-hard-delete"] =
+ _cli_options_map_["--warn-hard-delete"] =
&::cli::thunk< options, bool, &options::warn_hard_delete_ >;
- _cli_options_map_["--warn-hard"] =
+ _cli_options_map_["--warn-hard"] =
&::cli::thunk< options, bool, &options::warn_hard_ >;
- _cli_options_map_["--output-dir"] =
+ _cli_options_map_["--output-dir"] =
&::cli::thunk< options, std::string, &options::output_dir_,
&options::output_dir_specified_ >;
- _cli_options_map_["-o"] =
+ _cli_options_map_["-o"] =
&::cli::thunk< options, std::string, &options::output_dir_,
&options::output_dir_specified_ >;
- _cli_options_map_["--input-name"] =
+ _cli_options_map_["--input-name"] =
&::cli::thunk< options, std::string, &options::input_name_,
&options::input_name_specified_ >;
- _cli_options_map_["--changelog"] =
+ _cli_options_map_["--changelog"] =
&::cli::thunk< options, database_map<std::string>, &options::changelog_,
&options::changelog_specified_ >;
- _cli_options_map_["--changelog-in"] =
+ _cli_options_map_["--changelog-in"] =
&::cli::thunk< options, database_map<std::string>, &options::changelog_in_,
&options::changelog_in_specified_ >;
- _cli_options_map_["--changelog-out"] =
+ _cli_options_map_["--changelog-out"] =
&::cli::thunk< options, database_map<std::string>, &options::changelog_out_,
&options::changelog_out_specified_ >;
- _cli_options_map_["--changelog-dir"] =
+ _cli_options_map_["--changelog-dir"] =
&::cli::thunk< options, database_map<std::string>, &options::changelog_dir_,
&options::changelog_dir_specified_ >;
- _cli_options_map_["--init-changelog"] =
+ _cli_options_map_["--init-changelog"] =
&::cli::thunk< options, bool, &options::init_changelog_ >;
- _cli_options_map_["--odb-file-suffix"] =
+ _cli_options_map_["--odb-file-suffix"] =
&::cli::thunk< options, database_map<std::string>, &options::odb_file_suffix_,
&options::odb_file_suffix_specified_ >;
- _cli_options_map_["--sql-file-suffix"] =
+ _cli_options_map_["--sql-file-suffix"] =
&::cli::thunk< options, database_map<std::string>, &options::sql_file_suffix_,
&options::sql_file_suffix_specified_ >;
- _cli_options_map_["--schema-file-suffix"] =
+ _cli_options_map_["--schema-file-suffix"] =
&::cli::thunk< options, database_map<std::string>, &options::schema_file_suffix_,
&options::schema_file_suffix_specified_ >;
- _cli_options_map_["--changelog-file-suffix"] =
+ _cli_options_map_["--changelog-file-suffix"] =
&::cli::thunk< options, database_map<std::string>, &options::changelog_file_suffix_,
&options::changelog_file_suffix_specified_ >;
- _cli_options_map_["--hxx-suffix"] =
+ _cli_options_map_["--hxx-suffix"] =
&::cli::thunk< options, std::string, &options::hxx_suffix_,
&options::hxx_suffix_specified_ >;
- _cli_options_map_["--ixx-suffix"] =
+ _cli_options_map_["--ixx-suffix"] =
&::cli::thunk< options, std::string, &options::ixx_suffix_,
&options::ixx_suffix_specified_ >;
- _cli_options_map_["--cxx-suffix"] =
+ _cli_options_map_["--cxx-suffix"] =
&::cli::thunk< options, std::string, &options::cxx_suffix_,
&options::cxx_suffix_specified_ >;
- _cli_options_map_["--sql-suffix"] =
+ _cli_options_map_["--sql-suffix"] =
&::cli::thunk< options, std::string, &options::sql_suffix_,
&options::sql_suffix_specified_ >;
- _cli_options_map_["--changelog-suffix"] =
+ _cli_options_map_["--changelog-suffix"] =
&::cli::thunk< options, std::string, &options::changelog_suffix_,
&options::changelog_suffix_specified_ >;
- _cli_options_map_["--hxx-prologue"] =
+ _cli_options_map_["--hxx-prologue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::hxx_prologue_,
&options::hxx_prologue_specified_ >;
- _cli_options_map_["--ixx-prologue"] =
+ _cli_options_map_["--ixx-prologue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::ixx_prologue_,
&options::ixx_prologue_specified_ >;
- _cli_options_map_["--cxx-prologue"] =
+ _cli_options_map_["--cxx-prologue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::cxx_prologue_,
&options::cxx_prologue_specified_ >;
- _cli_options_map_["--schema-prologue"] =
+ _cli_options_map_["--schema-prologue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::schema_prologue_,
&options::schema_prologue_specified_ >;
- _cli_options_map_["--sql-prologue"] =
+ _cli_options_map_["--sql-prologue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_prologue_,
&options::sql_prologue_specified_ >;
- _cli_options_map_["--migration-prologue"] =
+ _cli_options_map_["--migration-prologue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::migration_prologue_,
&options::migration_prologue_specified_ >;
- _cli_options_map_["--sql-interlude"] =
+ _cli_options_map_["--sql-interlude"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_interlude_,
&options::sql_interlude_specified_ >;
- _cli_options_map_["--hxx-epilogue"] =
+ _cli_options_map_["--hxx-epilogue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::hxx_epilogue_,
&options::hxx_epilogue_specified_ >;
- _cli_options_map_["--ixx-epilogue"] =
+ _cli_options_map_["--ixx-epilogue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::ixx_epilogue_,
&options::ixx_epilogue_specified_ >;
- _cli_options_map_["--cxx-epilogue"] =
+ _cli_options_map_["--cxx-epilogue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::cxx_epilogue_,
&options::cxx_epilogue_specified_ >;
- _cli_options_map_["--schema-epilogue"] =
+ _cli_options_map_["--schema-epilogue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::schema_epilogue_,
&options::schema_epilogue_specified_ >;
- _cli_options_map_["--sql-epilogue"] =
+ _cli_options_map_["--sql-epilogue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_epilogue_,
&options::sql_epilogue_specified_ >;
- _cli_options_map_["--migration-epilogue"] =
+ _cli_options_map_["--migration-epilogue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::migration_epilogue_,
&options::migration_epilogue_specified_ >;
- _cli_options_map_["--hxx-prologue-file"] =
+ _cli_options_map_["--hxx-prologue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::hxx_prologue_file_,
&options::hxx_prologue_file_specified_ >;
- _cli_options_map_["--ixx-prologue-file"] =
+ _cli_options_map_["--ixx-prologue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::ixx_prologue_file_,
&options::ixx_prologue_file_specified_ >;
- _cli_options_map_["--cxx-prologue-file"] =
+ _cli_options_map_["--cxx-prologue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::cxx_prologue_file_,
&options::cxx_prologue_file_specified_ >;
- _cli_options_map_["--schema-prologue-file"] =
+ _cli_options_map_["--schema-prologue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::schema_prologue_file_,
&options::schema_prologue_file_specified_ >;
- _cli_options_map_["--sql-prologue-file"] =
+ _cli_options_map_["--sql-prologue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_prologue_file_,
&options::sql_prologue_file_specified_ >;
- _cli_options_map_["--migration-prologue-file"] =
+ _cli_options_map_["--migration-prologue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::migration_prologue_file_,
&options::migration_prologue_file_specified_ >;
- _cli_options_map_["--sql-interlude-file"] =
+ _cli_options_map_["--sql-interlude-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_interlude_file_,
&options::sql_interlude_file_specified_ >;
- _cli_options_map_["--hxx-epilogue-file"] =
+ _cli_options_map_["--hxx-epilogue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::hxx_epilogue_file_,
&options::hxx_epilogue_file_specified_ >;
- _cli_options_map_["--ixx-epilogue-file"] =
+ _cli_options_map_["--ixx-epilogue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::ixx_epilogue_file_,
&options::ixx_epilogue_file_specified_ >;
- _cli_options_map_["--cxx-epilogue-file"] =
+ _cli_options_map_["--cxx-epilogue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::cxx_epilogue_file_,
&options::cxx_epilogue_file_specified_ >;
- _cli_options_map_["--schema-epilogue-file"] =
+ _cli_options_map_["--schema-epilogue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::schema_epilogue_file_,
&options::schema_epilogue_file_specified_ >;
- _cli_options_map_["--sql-epilogue-file"] =
+ _cli_options_map_["--sql-epilogue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_epilogue_file_,
&options::sql_epilogue_file_specified_ >;
- _cli_options_map_["--migration-epilogue-file"] =
+ _cli_options_map_["--migration-epilogue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::migration_epilogue_file_,
&options::migration_epilogue_file_specified_ >;
- _cli_options_map_["--odb-prologue"] =
+ _cli_options_map_["--odb-prologue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::odb_prologue_,
&options::odb_prologue_specified_ >;
- _cli_options_map_["--odb-prologue-file"] =
+ _cli_options_map_["--odb-prologue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::odb_prologue_file_,
&options::odb_prologue_file_specified_ >;
- _cli_options_map_["--odb-epilogue"] =
+ _cli_options_map_["--odb-epilogue"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::odb_epilogue_,
&options::odb_epilogue_specified_ >;
- _cli_options_map_["--odb-epilogue-file"] =
+ _cli_options_map_["--odb-epilogue-file"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::odb_epilogue_file_,
&options::odb_epilogue_file_specified_ >;
- _cli_options_map_["--table-prefix"] =
+ _cli_options_map_["--table-prefix"] =
&::cli::thunk< options, database_map<std::string>, &options::table_prefix_,
&options::table_prefix_specified_ >;
- _cli_options_map_["--index-suffix"] =
+ _cli_options_map_["--index-suffix"] =
&::cli::thunk< options, database_map<std::string>, &options::index_suffix_,
&options::index_suffix_specified_ >;
- _cli_options_map_["--fkey-suffix"] =
+ _cli_options_map_["--fkey-suffix"] =
&::cli::thunk< options, database_map<std::string>, &options::fkey_suffix_,
&options::fkey_suffix_specified_ >;
- _cli_options_map_["--sequence-suffix"] =
+ _cli_options_map_["--sequence-suffix"] =
&::cli::thunk< options, database_map<std::string>, &options::sequence_suffix_,
&options::sequence_suffix_specified_ >;
- _cli_options_map_["--sql-name-case"] =
+ _cli_options_map_["--sql-name-case"] =
&::cli::thunk< options, database_map<name_case>, &options::sql_name_case_,
&options::sql_name_case_specified_ >;
- _cli_options_map_["--table-regex"] =
+ _cli_options_map_["--table-regex"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::table_regex_,
&options::table_regex_specified_ >;
- _cli_options_map_["--column-regex"] =
+ _cli_options_map_["--column-regex"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::column_regex_,
&options::column_regex_specified_ >;
- _cli_options_map_["--index-regex"] =
+ _cli_options_map_["--index-regex"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::index_regex_,
&options::index_regex_specified_ >;
- _cli_options_map_["--fkey-regex"] =
+ _cli_options_map_["--fkey-regex"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::fkey_regex_,
&options::fkey_regex_specified_ >;
- _cli_options_map_["--sequence-regex"] =
+ _cli_options_map_["--sequence-regex"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::sequence_regex_,
&options::sequence_regex_specified_ >;
- _cli_options_map_["--statement-regex"] =
+ _cli_options_map_["--statement-regex"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::statement_regex_,
&options::statement_regex_specified_ >;
- _cli_options_map_["--sql-name-regex"] =
+ _cli_options_map_["--sql-name-regex"] =
&::cli::thunk< options, database_map<std::vector<std::string> >, &options::sql_name_regex_,
&options::sql_name_regex_specified_ >;
- _cli_options_map_["--sql-name-regex-trace"] =
+ _cli_options_map_["--sql-name-regex-trace"] =
&::cli::thunk< options, bool, &options::sql_name_regex_trace_ >;
- _cli_options_map_["--accessor-regex"] =
+ _cli_options_map_["--accessor-regex"] =
&::cli::thunk< options, std::vector<std::string>, &options::accessor_regex_,
&options::accessor_regex_specified_ >;
- _cli_options_map_["--accessor-regex-trace"] =
+ _cli_options_map_["--accessor-regex-trace"] =
&::cli::thunk< options, bool, &options::accessor_regex_trace_ >;
- _cli_options_map_["--modifier-regex"] =
+ _cli_options_map_["--modifier-regex"] =
&::cli::thunk< options, std::vector<std::string>, &options::modifier_regex_,
&options::modifier_regex_specified_ >;
- _cli_options_map_["--modifier-regex-trace"] =
+ _cli_options_map_["--modifier-regex-trace"] =
&::cli::thunk< options, bool, &options::modifier_regex_trace_ >;
- _cli_options_map_["--include-with-brackets"] =
+ _cli_options_map_["--include-with-brackets"] =
&::cli::thunk< options, bool, &options::include_with_brackets_ >;
- _cli_options_map_["--include-prefix"] =
+ _cli_options_map_["--include-prefix"] =
&::cli::thunk< options, std::string, &options::include_prefix_,
&options::include_prefix_specified_ >;
- _cli_options_map_["--include-regex"] =
+ _cli_options_map_["--include-regex"] =
&::cli::thunk< options, std::vector<std::string>, &options::include_regex_,
&options::include_regex_specified_ >;
- _cli_options_map_["--include-regex-trace"] =
+ _cli_options_map_["--include-regex-trace"] =
&::cli::thunk< options, bool, &options::include_regex_trace_ >;
- _cli_options_map_["--guard-prefix"] =
+ _cli_options_map_["--guard-prefix"] =
&::cli::thunk< options, std::string, &options::guard_prefix_,
&options::guard_prefix_specified_ >;
- _cli_options_map_["--show-sloc"] =
+ _cli_options_map_["--show-sloc"] =
&::cli::thunk< options, bool, &options::show_sloc_ >;
- _cli_options_map_["--sloc-limit"] =
+ _cli_options_map_["--sloc-limit"] =
&::cli::thunk< options, std::size_t, &options::sloc_limit_,
&options::sloc_limit_specified_ >;
- _cli_options_map_["--options-file"] =
+ _cli_options_map_["--options-file"] =
&::cli::thunk< options, std::string, &options::options_file_,
&options::options_file_specified_ >;
- _cli_options_map_["-x"] =
+ _cli_options_map_["-x"] =
&::cli::thunk< options, std::vector<std::string>, &options::x_,
&options::x_specified_ >;
- _cli_options_map_["-v"] =
+ _cli_options_map_["-v"] =
&::cli::thunk< options, bool, &options::v_ >;
- _cli_options_map_["--trace"] =
+ _cli_options_map_["--trace"] =
&::cli::thunk< options, bool, &options::trace_ >;
- _cli_options_map_["--mysql-engine"] =
+ _cli_options_map_["--mysql-engine"] =
&::cli::thunk< options, std::string, &options::mysql_engine_,
&options::mysql_engine_specified_ >;
- _cli_options_map_["--sqlite-override-null"] =
+ _cli_options_map_["--sqlite-override-null"] =
&::cli::thunk< options, bool, &options::sqlite_override_null_ >;
- _cli_options_map_["--sqlite-lax-auto-id"] =
+ _cli_options_map_["--sqlite-lax-auto-id"] =
&::cli::thunk< options, bool, &options::sqlite_lax_auto_id_ >;
- _cli_options_map_["--pgsql-server-version"] =
+ _cli_options_map_["--pgsql-server-version"] =
&::cli::thunk< options, ::pgsql_version, &options::pgsql_server_version_,
&options::pgsql_server_version_specified_ >;
- _cli_options_map_["--oracle-client-version"] =
+ _cli_options_map_["--oracle-client-version"] =
&::cli::thunk< options, ::oracle_version, &options::oracle_client_version_,
&options::oracle_client_version_specified_ >;
- _cli_options_map_["--oracle-warn-truncation"] =
+ _cli_options_map_["--oracle-warn-truncation"] =
&::cli::thunk< options, bool, &options::oracle_warn_truncation_ >;
- _cli_options_map_["--mssql-server-version"] =
+ _cli_options_map_["--mssql-server-version"] =
&::cli::thunk< options, ::mssql_version, &options::mssql_server_version_,
&options::mssql_server_version_specified_ >;
- _cli_options_map_["--mssql-short-limit"] =
+ _cli_options_map_["--mssql-short-limit"] =
&::cli::thunk< options, unsigned int, &options::mssql_short_limit_,
&options::mssql_short_limit_specified_ >;
}
@@ -3801,7 +3826,7 @@ _parse (::cli::scanner& s,
cf[2] = '\0';
int ac (1);
- char* av[] =
+ char* av[] =
{
cf
};
diff --git a/odb/options.hxx b/odb/options.hxx
index 241c8a9..dce0fe0 100644
--- a/odb/options.hxx
+++ b/odb/options.hxx
@@ -448,6 +448,8 @@ namespace cli
#include <cstddef>
+#include <cstdint>
+
#include <odb/option-types.hxx>
class options
@@ -489,6 +491,21 @@ class options
// Option accessors and modifiers.
//
+ const std::uint64_t&
+ build2_metadata () const;
+
+ std::uint64_t&
+ build2_metadata ();
+
+ void
+ build2_metadata (const std::uint64_t&);
+
+ bool
+ build2_metadata_specified () const;
+
+ void
+ build2_metadata_specified (bool);
+
const bool&
help () const;
@@ -2075,6 +2092,8 @@ class options
::cli::unknown_mode argument);
public:
+ std::uint64_t build2_metadata_;
+ bool build2_metadata_specified_;
bool help_;
bool version_;
std::vector<std::string> I_;
diff --git a/odb/options.ixx b/odb/options.ixx
index e0317cb..87e81bc 100644
--- a/odb/options.ixx
+++ b/odb/options.ixx
@@ -300,6 +300,36 @@ namespace cli
// options
//
+inline const std::uint64_t& options::
+build2_metadata () const
+{
+ return this->build2_metadata_;
+}
+
+inline std::uint64_t& options::
+build2_metadata ()
+{
+ return this->build2_metadata_;
+}
+
+inline void options::
+build2_metadata(const std::uint64_t& x)
+{
+ this->build2_metadata_ = x;
+}
+
+inline bool options::
+build2_metadata_specified () const
+{
+ return this->build2_metadata_specified_;
+}
+
+inline void options::
+build2_metadata_specified(bool x)
+{
+ this->build2_metadata_specified_ = x;
+}
+
inline const bool& options::
help () const
{
diff --git a/odb/parser.cxx b/odb/parser.cxx
index 7286fca..58388c9 100644
--- a/odb/parser.cxx
+++ b/odb/parser.cxx
@@ -890,15 +890,23 @@ collect (tree ns)
{
case TYPE_DECL:
{
- if (DECL_NAME (decl) != NULL_TREE)
- decls_.insert (decl);
+ // Skip special type declarations.
+ //
+ if (DECL_NAME (decl) == NULL_TREE)
+ continue;
+ tree type (TREE_TYPE (decl));
+ if (LAMBDA_TYPE_P (type))
+ continue;
+
+ decls_.insert (decl);
break;
}
case TEMPLATE_DECL:
{
if (DECL_CLASS_TEMPLATE_P (decl))
decls_.insert (decl);
+
break;
}
default:
@@ -1095,14 +1103,14 @@ emit_type_decl (tree decl)
// says that in typedef struct {} S; S becomes struct's
// name.
//
- if (anon_aggrname_p (decl_name))
+ if (IDENTIFIER_ANON_P (decl_name))
{
tree d (TYPE_NAME (t));
if (d != NULL_TREE &&
!DECL_ARTIFICIAL (d) &&
DECL_NAME (d) != NULL_TREE &&
- !anon_aggrname_p (DECL_NAME (d)))
+ !IDENTIFIER_ANON_P (DECL_NAME (d)))
{
decl = d;
decl_name = DECL_NAME (decl);
@@ -1719,7 +1727,7 @@ create_type (tree t,
ts << "start anon/stub " << gcc_tree_code_name(tc) << " at "
<< file << ":" << line << endl;
- if (d == NULL_TREE || anon_aggrname_p (DECL_NAME (d)))
+ if (d == NULL_TREE || IDENTIFIER_ANON_P (DECL_NAME (d)))
{
if (tc == RECORD_TYPE)
r = &emit_class<class_> (t, file, line, clmn);
@@ -1816,7 +1824,7 @@ create_type (tree t,
ts << "start anon/stub " << gcc_tree_code_name(tc) << " at "
<< file << ":" << line << endl;
- if (d == NULL_TREE || anon_aggrname_p (DECL_NAME (d)))
+ if (d == NULL_TREE || IDENTIFIER_ANON_P (DECL_NAME (d)))
{
r = &emit_enum (t, access, file, line, clmn);
}
diff --git a/odb/semantics/class.cxx b/odb/semantics/class.cxx
index c03de92..acecb35 100644
--- a/odb/semantics/class.cxx
+++ b/odb/semantics/class.cxx
@@ -25,11 +25,39 @@ namespace semantics
{
tree t (tree_node ());
- // TYPE_HAS_DEFAULT_CONSTRUCTOR() returns true if we have a
- // deleted default ctor. locate_ctor(), on the other hand,
- // returns NULL_TREE in this case.
+ // TYPE_HAS_DEFAULT_CONSTRUCTOR() returns true if we have a deleted
+ // default ctor. locate_ctor(), on the other hand, returns NULL_TREE in
+ // this case.
//
- return TYPE_HAS_DEFAULT_CONSTRUCTOR (t) && locate_ctor (t) != NULL_TREE;
+ if (TYPE_HAS_DEFAULT_CONSTRUCTOR (t))
+ {
+#if BUILDING_GCC_MAJOR >= 8
+
+ // Work around GCC bug 86441. Essentially, we should not trigger an
+ // instantiation or completion of the default ctor. As a result, we will
+ // assume that if we have a lazy default ctor, it is not implicitly
+ // deleted.
+ //
+ if (CLASSTYPE_LAZY_DEFAULT_CTOR (t))
+ return true;
+
+ for (ovl_iterator i (CLASSTYPE_CONSTRUCTORS (t)); i; ++i)
+ {
+ tree f (*i);
+
+ if (TREE_CODE (f) == FUNCTION_DECL && DECL_DELETED_FN (f))
+ continue;
+
+ if (default_ctor_p (f))
+ return true;
+ }
+#else
+ return locate_ctor (t) != NULL_TREE;
+#endif
+
+ }
+
+ return false;
}
bool class_::
diff --git a/odb/semantics/elements.cxx b/odb/semantics/elements.cxx
index f937f54..2d266cf 100644
--- a/odb/semantics/elements.cxx
+++ b/odb/semantics/elements.cxx
@@ -75,7 +75,7 @@ namespace semantics
if (tree decl = TYPE_NAME (n))
name = DECL_NAME (decl);
- return name != 0 && anon_aggrname_p (name);
+ return name != 0 && IDENTIFIER_ANON_P (name);
}
return true;
@@ -124,7 +124,7 @@ namespace semantics
if (tree decl = TYPE_NAME (type))
{
name = DECL_NAME (decl);
- if (name != 0 && anon_aggrname_p (name))
+ if (name != 0 && IDENTIFIER_ANON_P (name))
return true;
tree s (CP_DECL_CONTEXT (decl));
diff --git a/odb/validator.cxx b/odb/validator.cxx
index 9c20714..bf9aa6b 100644
--- a/odb/validator.cxx
+++ b/odb/validator.cxx
@@ -1655,6 +1655,9 @@ namespace
// temporarily redirect diagnostics to /dev/null, which is
// where asm_out_file points to (see plugin.cxx).
//
+ // Needless to say, this is very hacky and we should quickly fail
+ // (as we do below) if there were errors.
+ //
int ec (errorcount);
FILE* s (global_dc->printer->buffer->stream);
global_dc->printer->buffer->stream = asm_out_file;
diff --git a/odb/version.hxx b/odb/version.hxx
index 8b4e379..edc58a1 100644
--- a/odb/version.hxx
+++ b/odb/version.hxx
@@ -23,12 +23,15 @@
// ODB interface version: minor, major, and alpha/beta versions.
//
-#define ODB_VERSION 20468
-#define ODB_VERSION_STR "2.5-b.18"
+#define ODB_VERSION 20470
+#define ODB_VERSION_STR "2.5-b.20"
// ODB compiler version: interface version plus the bugfix version.
//
-#define ODB_COMPILER_VERSION 2049968
-#define ODB_COMPILER_VERSION_STR "2.5.0-b.18"
+// NOTE: remember to update metadata to full version when switching to
+// version.hxx.in.
+//
+#define ODB_COMPILER_VERSION 2049970
+#define ODB_COMPILER_VERSION_STR "2.5.0-b.20"
#endif // ODB_VERSION_HXX
diff --git a/tests/build/root.build b/tests/build/root.build
index 1800d29..c797685 100644
--- a/tests/build/root.build
+++ b/tests/build/root.build
@@ -1,6 +1,11 @@
# file : tests/build/root.build
# license : GNU GPL v3; see accompanying LICENSE file
+# We need to configure C++ module to obtain the target information (see
+# below).
+#
+using cxx.config
+
# Import the ODB compiler we will be testing.
#
import odb = odb%exe{odb}
diff --git a/version b/version
index a9b5191..a60117f 100644
--- a/version
+++ b/version
@@ -1 +1 @@
-2.5.0-b.18
+2.5.0-b.20