INNER CODE UNIT · Python

_NeedToReturnSomethingDiagnoser

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

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

  gcc_regex = (_GCC_FILE_LINE_RE + r'(instantiated from here\n.'
               r'*gmock.*actions\.h.*error: void value not ignored)'
               r'|(error: control reaches end of non-void function)')
  clang_regex1 = (_CLANG_FILE_LINE_RE +
                  r'error: cannot initialize return object '
                  r'of type \'Result\' \(aka \'(?P<return_type>.*)\'\) '
                  r'with an rvalue of type \'void\'')
  clang_regex2 = (_CLANG_FILE_LINE_RE +
                  r'error: cannot initialize return object '
                  r'of type \'(?P<return_type>.*)\' '
                  r'with an rvalue of type \'void\'')
  diagnosis = """
You are using an action that returns void, but it needs to return
%(return_type)s.  Please tell it *what* to return.  Perhaps you can use
the pattern DoAll(some_action, Return(some_value))?"""

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…