diff options
Diffstat (limited to 'xsd')
-rw-r--r-- | xsd/cxx/tree/elements.cxx | 7 | ||||
-rw-r--r-- | xsd/processing/inheritance/processor.cxx | 7 |
2 files changed, 14 insertions, 0 deletions
diff --git a/xsd/cxx/tree/elements.cxx b/xsd/cxx/tree/elements.cxx index d5f03c0..04bff38 100644 --- a/xsd/cxx/tree/elements.cxx +++ b/xsd/cxx/tree/elements.cxx @@ -604,6 +604,13 @@ namespace CXX Boolean Context:: polymorphic_p (SemanticGraph::Type& t) { + // ID/IDREF templates cannot be polymorphic. + // + if (!t.named_p () && + (t.is_a<SemanticGraph::Fundamental::Id> () || + t.is_a<SemanticGraph::Fundamental::IdRef> ())) + return false; + if (polymorphic_all) { Boolean fund (false); diff --git a/xsd/processing/inheritance/processor.cxx b/xsd/processing/inheritance/processor.cxx index d92ea6c..032803b 100644 --- a/xsd/processing/inheritance/processor.cxx +++ b/xsd/processing/inheritance/processor.cxx @@ -242,6 +242,13 @@ namespace Processing Dep const& dep (*i); Type& t (dep.type); + // Ignore ID/IDREF templates. + // + if (!t.named_p () && + (t.is_a<SemanticGraph::Fundamental::Id> () || + t.is_a<SemanticGraph::Fundamental::IdRef> ())) + continue; + // We won't be able to generate compilable code in case of a // dependency on ourselves (e.g., a member element with // anonymous type that inherits from us). |