aboutsummaryrefslogtreecommitdiff
path: root/xsd
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-01-09 11:33:58 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-01-09 11:37:10 +0200
commit3d3ac8cec9f1d759cf23952a39da62ba716a9ea1 (patch)
treec4e7ffb6015b10bd3952531c2b3f920fef725dd4 /xsd
parentefbc3c3186944bc0373f8d0f4ae07058616d5c10 (diff)
Generate default c-tor for list-based enumerations
Diffstat (limited to 'xsd')
-rw-r--r--xsd/cxx/tree/tree-header.cxx8
-rw-r--r--xsd/cxx/tree/tree-inline.cxx8
2 files changed, 14 insertions, 2 deletions
diff --git a/xsd/cxx/tree/tree-header.cxx b/xsd/cxx/tree/tree-header.cxx
index f576645..09bbe78 100644
--- a/xsd/cxx/tree/tree-header.cxx
+++ b/xsd/cxx/tree/tree-header.cxx
@@ -703,7 +703,13 @@ namespace CXX
// default c-tor
//
- if (options.generate_default_ctor ())
+ bool list_based (
+ ult_base.is_a<SemanticGraph::List> () ||
+ ult_base.is_a<SemanticGraph::Fundamental::NameTokens> () ||
+ ult_base.is_a<SemanticGraph::Fundamental::IdRefs> () ||
+ ult_base.is_a<SemanticGraph::Fundamental::Entities> ());
+
+ if (options.generate_default_ctor () || list_based)
{
if (doxygen)
{
diff --git a/xsd/cxx/tree/tree-inline.cxx b/xsd/cxx/tree/tree-inline.cxx
index 500ee73..d2ee0ba 100644
--- a/xsd/cxx/tree/tree-inline.cxx
+++ b/xsd/cxx/tree/tree-inline.cxx
@@ -297,7 +297,13 @@ namespace CXX
// default c-tor
//
- if (options.generate_default_ctor ())
+ bool list_based (
+ ult_base.is_a<SemanticGraph::List> () ||
+ ult_base.is_a<SemanticGraph::Fundamental::NameTokens> () ||
+ ult_base.is_a<SemanticGraph::Fundamental::IdRefs> () ||
+ ult_base.is_a<SemanticGraph::Fundamental::Entities> ());
+
+ if (options.generate_default_ctor () || list_based)
{
os << inl
<< name << "::" << endl