From 60f040e8b1aa413b99c8bbc2d6bec43a34521aa8 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 31 Aug 2015 14:26:14 +0200 Subject: Don't try to analyze callback signature if one wasn't found --- odb/validator.cxx | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/odb/validator.cxx b/odb/validator.cxx index 6384d83..6975736 100644 --- a/odb/validator.cxx +++ b/odb/validator.cxx @@ -508,7 +508,28 @@ namespace lookup_qualified_name ( c.tree_node (), get_identifier (name.c_str ()), false, false)); - if (decl == error_mark_node || TREE_CODE (decl) != BASELINK) + if (decl != error_mark_node && TREE_CODE (decl) == BASELINK) + { + // Figure out if we have a const version of the callback. OVL_* + // macros work for both FUNCTION_DECL and OVERLOAD. + // + for (tree o (BASELINK_FUNCTIONS (decl)); o != 0; o = OVL_NEXT (o)) + { + tree f (OVL_CURRENT (o)); + if (DECL_CONST_MEMFUNC_P (f)) + { + c.set ("callback-const", true); + break; + } + } + + //@@ Would be nice to check the signature of the function(s) + // instead of postponing it until the C++ compilation. Though + // we may still get C++ compilation errors because of const + // mismatch. + // + } + else { os << c.file () << ":" << c.line () << ":" << c.column () << ": " << "error: unable to resolve member function '" << name << "' " @@ -517,25 +538,6 @@ namespace valid_ = false; } - - // Figure out if we have a const version of the callback. OVL_* - // macros work for both FUNCTION_DECL and OVERLOAD. - // - for (tree o (BASELINK_FUNCTIONS (decl)); o != 0; o = OVL_NEXT (o)) - { - tree f (OVL_CURRENT (o)); - if (DECL_CONST_MEMFUNC_P (f)) - { - c.set ("callback-const", true); - break; - } - } - - //@@ Would be nice to check the signature of the function(s) - // instead of postponing it until the C++ compilation. Though - // we may still get C++ compilation errors because of const - // mismatch. - // } // Check bases. -- cgit v1.1