diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-08-31 14:26:14 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-08-31 14:26:14 +0200 |
commit | 60f040e8b1aa413b99c8bbc2d6bec43a34521aa8 (patch) | |
tree | 55c41a48b35cfba81d89e6600bc640a26e971a7f | |
parent | de130e93d8b2c026732211e67b6f31157f1b7e87 (diff) |
Don't try to analyze callback signature if one wasn't found
-rw-r--r-- | odb/validator.cxx | 42 |
1 files 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. |