Uploaded image for project: 'SonarCFamily'
  1. SonarCFamily
  2. CPP-2368

S5425: Fix false-positives by only reporting when a forwarding reference is never forwarded

    Details

    • Type: False-Positive
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.7
    • Component/s: C++
    • Labels:
      None

      Description

      We should trigger only if the forwarding reference is passed to a function without "std::forward".

      We should ignore If:

      • The forwarding reference is iterated on using range for_loop.
      • If a member function is accessed begin().
      • If a field is accessed. 

        Attachments

        1. FP.PNG
          FP.PNG
          26 kB
        2. FP1.PNG
          FP1.PNG
          9 kB
        3. FP2.PNG
          FP2.PNG
          36 kB

          Issue Links

            Activity

              People

              • Assignee:
                abbas.sabra Abbas Sabra
                Reporter:
                abbas.sabra Abbas Sabra
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: