INNER CODE UNIT · Python

_OverloadedFunctionMatcherDiagnoser

hongliuliao/ehttp · deps/googletest/googlemock/scripts/gmock_doctor.py:282

def _OverloadedFunctionMatcherDiagnoser(msg):
  """Diagnoses the OFM disease, given the error messages by the compiler."""

  gcc_regex = (_GCC_FILE_LINE_RE + r'error: no matching function for '
               r'call to \'Truly\(<unresolved overloaded function type>\)')
  clang_regex = (_CLANG_FILE_LINE_RE + r'error: no matching function for '
                 r'call to \'Truly')
  diagnosis = """
The argument you gave to Truly() is an overloaded function.  Please tell
your compiler which overloaded version you want to use.

For example, if you want to use the version whose signature is
  bool Foo(int n);
you should write
  Truly(static_cast<bool (*)(int n)>(Foo))"""
  return _GenericDiagnoser('OFM', 'Overloaded Function Matcher',
                           [(gcc_regex, diagnosis),
                            (clang_regex, diagnosis)],

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…