From 676cf6420dbc11c15322ca528386a8032b9872a0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 1 Jun 2012 17:03:45 +0200 Subject: Fix incorrect handling of IDREF templates when used as bases --- xsd/cxx/tree/elements.cxx | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'xsd/cxx/tree/elements.cxx') 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 () || - t.is_a ())) + (t.is_a () || + t.is_a ())) 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 () || - t.is_a ())) + (t.is_a () || + t.is_a ())) 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_; } -- cgit v1.1