Remove forbidden downcast
This removes several constructors and assignments from base class in the class hierarchy around base_array
. These removed methods are all implemented using a downcast which may result in undefined behaviour.
Since they are not used anywhere in the core modules we can maybe remove them. According to @markus.blatt these base classes are all meant to be internal.
This may cause problems if user code explicitly uses the raw base classes and these methods. However, such user code would only be valid if the passed base class reference is actually an upcasted derived class which is very unlikely.
Merge request reports
Activity
@markus.blatt: Since I'm not familiar with all implementation details of this class hierarchy I'd like to ask you to check if this removal is OK. At least it does not break the tests in istl for me.
Mentioned in issue #22
I'm sorry, I missed this. Unfortunately the tests in
dune/istl/tutorial/example.cc
are not triggered bymake build_tests
.It seems that these casts are really used. To me the proxy container
VariableBlockVector
has a rather strange implementation. The conversion from proxy to a free object normally happens in the proxy. Here it was the other way around an the free object had an assignment from proxy.I'm sorry, I missed this. Unfortunately the tests in |dune/istl/tutorial/example.cc| are not triggered by |make build_tests|.
Well, example.cc is one of the dune-istl peculiarities, because it is not really an example.
It seems that these casts are really used. To me the proxy container |VariableBlockVector| has a rather strange implementation. The conversion from proxy to a free object normally happens in the proxy. Here it was the other way around an the free object had an assignment from proxy.
Patches are welcome.
Added 8 commits:
-
f6d826ba...3119e52b - 5 commits from branch
master
- dd4e07de - Remove check for constructor/assignment from base class
- c5e023c5 - Remove unused methods based on unsave casts
- b797918e - Implement assignment of BlockVector from BlockVectorWindow
Toggle commit list-
f6d826ba...3119e52b - 5 commits from branch
Milestone changed to %DUNE 2.5.0
Added backport label
Mentioned in commit d487fef6
Mentioned in commit 140d4af0
Mentioned in merge request !69 (merged)
Mentioned in commit d6be0ed1
mentioned in commit df036744