Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-1006

Parameters in an overriding virtual function shall either use the same default arguments as the function they override, or else shall not specify any default arguments

    XMLWordPrintable

    Details

    • Message:
      Remove the default value for parameter "xxx" or set it to the same value as in the base class.
    • Default Severity:
      Critical
    • Impact:
      High
    • Likelihood:
      Low
    • Default Quality Profiles:
      MISRA C++ 2008
    • Covered Languages:
      C#, C++
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      10min
    • Analysis Scope:
      Main Sources, Test Sources
    • CppCoreGuidelines:
      C.140
    • ReSharper:
      OptionalParameterHierarchyMismatch

      Description

      This rule is a strict implementation of a MISRA (Motor Industry Software Reliability Association) rule. MISRA defines best practices for developing safety-critical software. You can learn more about this rule in the MISRA documents referenced below.

      See

      • MISRA C++ 2008, 8-3-1 - Parameters in a overriding virtual function shall either use the same default arguments as the function they override, or else shall not specify any default arguments.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              Anonymous Anonymous
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated: