INNER CODE UNIT · Python

_NeedToUseReturnNullDiagnoser

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

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

  gcc_regex = ('instantiated from \'testing::internal::ReturnAction<R>'
               '::operator testing::Action<Func>\(\) const.*\n' +
               _GCC_FILE_LINE_RE + r'instantiated from here\n'
               r'.*error: no matching function for call to \'ImplicitCast_\('
               r'(:?long )?int&\)')
  clang_regex = (r'\bgmock-actions.h:.* error: no matching function for '
                 r'call to \'ImplicitCast_\'\r?\n'
                 r'(.*\n)*?' +
                 _CLANG_NON_GMOCK_FILE_LINE_RE + r'note: in instantiation '
                 r'of function template specialization '
                 r'\'testing::internal::ReturnAction<(int|long)>::operator '
                 r'Action<(?P<type>.*)\(\)>\' requested here')
  diagnosis = """
You are probably calling Return(NULL) and the compiler isn't sure how to turn
NULL into %(type)s. Use ReturnNull() instead.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…