diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-06-01 17:03:45 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-06-01 17:03:45 +0200 |
commit | 676cf6420dbc11c15322ca528386a8032b9872a0 (patch) | |
tree | d342e41aca6376d99bd3839624840460d21b9ff6 /xsd/cxx/tree/elements.cxx | |
parent | 4661c1a12a491132784ffe5e3d4702d9a9bf6072 (diff) |
Fix incorrect handling of IDREF templates when used as bases
Diffstat (limited to 'xsd/cxx/tree/elements.cxx')
-rw-r--r-- | xsd/cxx/tree/elements.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/xsd/cxx/tree/elements.cxx b/xsd/cxx/tree/elements.cxx index 233063a..63f31a7 100644 --- a/xsd/cxx/tree/elements.cxx +++ b/xsd/cxx/tree/elements.cxx @@ -604,11 +604,11 @@ namespace CXX Boolean Context:: polymorphic_p (SemanticGraph::Type& t) { - // ID/IDREF templates cannot be polymorphic. + // IDREF templates cannot be polymorphic. // if (!t.named_p () && - (t.is_a<SemanticGraph::Fundamental::Id> () || - t.is_a<SemanticGraph::Fundamental::IdRef> ())) + (t.is_a<SemanticGraph::Fundamental::IdRef> () || + t.is_a<SemanticGraph::Fundamental::IdRefs> ())) return false; if (polymorphic_all) @@ -625,11 +625,11 @@ namespace CXX Boolean Context:: anonymous_substitutes_p (SemanticGraph::Type& t) { - // ID/IDREF templates cannot match. + // IDREF templates cannot match. // if (!t.named_p () && - (t.is_a<SemanticGraph::Fundamental::Id> () || - t.is_a<SemanticGraph::Fundamental::IdRef> ())) + (t.is_a<SemanticGraph::Fundamental::IdRef> () || + t.is_a<SemanticGraph::Fundamental::IdRefs> ())) return false; // See which elements this type classifies. @@ -962,7 +962,11 @@ namespace CXX if (base_arg_ != 0) { - *base_arg_ = L"_xsd_" + ename (t) + L"_base"; + // IDREF templates don't have a name. + // + *base_arg_ = t.named_p () + ? (L"_xsd_" + ename (t) + L"_base") + : L"_xsd_base"; os << " " << *base_arg_; } |