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

S1172: Fix false-positives with virtual function

    XMLWordPrintable

    Details

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

      Description

      False positive in the following case:

      class Base {
      public:
        virtual ~Base() = default;
        virtual int f(int i) { // Should not raise an issue
          return 0;
        }
      };
      
      class Derived : public Base {
      public:
        int f(int i) override {
          return i;
        }
      };
      
      
      

      Also, fix false-positive when "main" argument is not used.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              abbas.sabra Abbas Sabra
              Reporter:
              loic.joly Loïc Joly
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: