diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2021-02-02 17:20:22 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2021-02-25 13:39:56 +0300 |
commit | 18b50b6671c680287503cf89c09887182ae38626 (patch) | |
tree | 37a17e2da5dd9c7c6d06722467a2065400e86bb5 | |
parent | e37f54594630520a71ec139e735fa819de4b852a (diff) |
Suppress various Clang/GCC warnings
-rw-r--r-- | libxsd-frontend/parser.cxx | 4 | ||||
-rw-r--r-- | libxsd-frontend/transformations/anonymous.cxx | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/libxsd-frontend/parser.cxx b/libxsd-frontend/parser.cxx index 06cd960..f300722 100644 --- a/libxsd-frontend/parser.cxx +++ b/libxsd-frontend/parser.cxx @@ -1977,6 +1977,8 @@ namespace XSDFrontend Traversal::Element, Traversal::Member { + using Member::traverse; + AnonymousMember (Traversal::NodeDispatcher& d) { belongs_.node_traverser (d); @@ -2226,6 +2228,8 @@ namespace XSDFrontend Traversal::Element, Traversal::Member { + using Member::traverse; + AnonymousMember (Traversal::NodeDispatcher& d) { belongs_.node_traverser (d); diff --git a/libxsd-frontend/transformations/anonymous.cxx b/libxsd-frontend/transformations/anonymous.cxx index 078492d..7889813 100644 --- a/libxsd-frontend/transformations/anonymous.cxx +++ b/libxsd-frontend/transformations/anonymous.cxx @@ -219,7 +219,12 @@ namespace XSDFrontend // With the same kind of inheritance (restriction or extension). // - if (typeid (x.inherits ()) != typeid (y.inherits ())) + // Suppress the Clang's 'expression with side effects will be + // evaluated despite being used as an operand to typeid' warning. + // + const SemanticGraph::Inherits& xi (x.inherits ()); + const SemanticGraph::Inherits& yi (y.inherits ()); + if (typeid (xi) != typeid (yi)) return; // Bases should be the same. @@ -252,7 +257,9 @@ namespace XSDFrontend Scope::NamesIterator ix (x.names_begin ()), iy (y.names_begin ()); for (; ix != x.names_end () && iy != y.names_end (); ++ix, ++iy) { - if (typeid (ix->named ()) != typeid (iy->named ())) + const SemanticGraph::Nameable& xn (ix->named ()); + const SemanticGraph::Nameable& yn (iy->named ()); + if (typeid (xn) != typeid (yn)) return; bool equal (false); |