Details
-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
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
- is implemented by
-
CPP-1627 Rule S1006: 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
-
- Closed
-
- is related to
-
CPP-2510 S3923: Improve code equivalence checking in case of macro expansion
-
- To Do
-
- relates to
-
RSPEC-3719 Virtual functions should not have default arguments
- Active
1.
|
C#: Method overrides should not change parameter defaults | RSPEC-3455 |
|
Active | Unassigned | |
2.
|
C-Family | RSPEC-1255 |
|
Active | Unassigned |