Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
D
dune-istl
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 27
    • Issues 27
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 25
    • Merge Requests 25
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Core Modules
  • dune-istl
  • Issues
  • #79

Closed
Open
Created Oct 13, 2019 by Santiago Ospina De Los Ríos@santiago.ospinaDeveloper

Missing deprecation of virtual methods when changing functions contsness

Recently, in PDELab, we have noticed several (not nice) bugs due that some virtual methods have changed to be const without a proper deprecation (See 0cfd4a01). When adding or removing const-ness of a function, you are actually changing the signature of the function and hence, changing the behavior of all of those inheriting and overriding it.

I understand that is an error of the two sides. One for not using a deprecation method after the change, and second because the downstream project was not using the override keyword. But is a simple change here that may save a lot of troubles for all of those that forgot the override keyword.

struct Class {
  // new interface
   virtual void my_function() const // <- const was added
   {
     // similar functionality as non const function before ... 
   }

  // old interface
   DUNE_DEPRECATED virtual void my_function() 
   {
     // forward to the new method
     const_cast<const Class*>(this)->my_function(); 
   }
};
Edited Oct 13, 2019 by Santiago Ospina De Los Ríos
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None