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

Rule: Update S2303 to not raise issues for noexcept and overridden methods

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.8
    • Fix Version/s: 4.0
    • Component/s: C++
    • Labels:
      None

      Description

      RSPEC-2303 updated to not raise issues for noexcept and overridden methods.

      If in a base class "A", a virtual function "func" contains an exception specification:

      class A {
        virtual void func() throw();
      };
      

      .. then, when a derived class "B" overrides the function "func", we should not rise ExceptionSpecificationUsage issue about "throw()" in the derived class "B". It is imposed by the declaration of the overridden function "func" in "A":

      class B : public A {
        void func() throw() override; // Compliant
      };
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              alban.auzeill Alban Auzeill
              Reporter:
              alban.auzeill Alban Auzeill
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: