Skip to content

Commit

Permalink
Make Binding and CopyBinding specializations final (#4022)
Browse files Browse the repository at this point in the history
The Binding specializations call it virtual functions numOfRowsHandled()
and reset() from their constructors. This is fine assuming virtual
function dispatch to a further derived class was not intended. In this
case the assumption is solid, however this triggers the Clang diagnostic
clang-analyzer-optin.cplusplus.VirtualCall

Adding the final specifyer to these specializations gives Clang enough
of a hint to silence
  • Loading branch information
OwenKnight-FLINTpro authored Nov 27, 2023
1 parent 862b1ad commit 9141368
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions Data/include/Poco/Data/Binding.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace Data {


template <class T>
class Binding: public AbstractBinding
class Binding final: public AbstractBinding
/// Binding maps a value or multiple values (see Binding specializations for STL containers as
/// well as type handlers) to database column(s). Values to be bound can be either mapped
/// directly (by reference) or a copy can be created, depending on the value of the copy argument.
Expand Down Expand Up @@ -109,7 +109,7 @@ class Binding: public AbstractBinding


template <class T>
class CopyBinding: public AbstractBinding
class CopyBinding final: public AbstractBinding
/// Binding maps a value or multiple values (see Binding specializations for STL containers as
/// well as type handlers) to database column(s). Values to be bound can be either mapped
/// directly (by reference) or a copy can be created, depending on the value of the copy argument.
Expand Down Expand Up @@ -177,7 +177,7 @@ class CopyBinding: public AbstractBinding


template <>
class Binding<const char*>: public AbstractBinding
class Binding<const char*> final: public AbstractBinding
/// Binding const char* specialization wraps char pointer into string.
{
public:
Expand Down Expand Up @@ -238,7 +238,7 @@ class Binding<const char*>: public AbstractBinding


template <>
class CopyBinding<const char*>: public AbstractBinding
class CopyBinding<const char*> final: public AbstractBinding
/// Binding const char* specialization wraps char pointer into string.
{
public:
Expand Down Expand Up @@ -298,7 +298,7 @@ class CopyBinding<const char*>: public AbstractBinding


template <class T>
class Binding<std::vector<T>>: public AbstractBinding
class Binding<std::vector<T>> final: public AbstractBinding
/// Specialization for std::vector.
{
public:
Expand Down Expand Up @@ -364,7 +364,7 @@ class Binding<std::vector<T>>: public AbstractBinding


template <class T>
class CopyBinding<std::vector<T>>: public AbstractBinding
class CopyBinding<std::vector<T>> final: public AbstractBinding
/// Specialization for std::vector.
{
public:
Expand Down Expand Up @@ -431,7 +431,7 @@ class CopyBinding<std::vector<T>>: public AbstractBinding


template <>
class Binding<std::vector<bool>>: public AbstractBinding
class Binding<std::vector<bool>> final: public AbstractBinding
/// Specialization for std::vector<bool>.
/// This specialization is necessary due to the nature of std::vector<bool>.
/// For details, see the standard library implementation of std::vector<bool>
Expand Down Expand Up @@ -512,7 +512,7 @@ class Binding<std::vector<bool>>: public AbstractBinding


template <>
class CopyBinding<std::vector<bool>>: public AbstractBinding
class CopyBinding<std::vector<bool>> final: public AbstractBinding
/// Specialization for std::vector<bool>.
/// This specialization is necessary due to the nature of std::vector<bool>.
/// For details, see the standard library implementation of std::vector<bool>
Expand Down Expand Up @@ -592,7 +592,7 @@ class CopyBinding<std::vector<bool>>: public AbstractBinding


template <class T>
class Binding<std::list<T>>: public AbstractBinding
class Binding<std::list<T>> final: public AbstractBinding
/// Specialization for std::list.
{
public:
Expand Down Expand Up @@ -657,7 +657,7 @@ class Binding<std::list<T>>: public AbstractBinding


template <class T>
class CopyBinding<std::list<T>>: public AbstractBinding
class CopyBinding<std::list<T>> final: public AbstractBinding
/// Specialization for std::list.
{
public:
Expand Down Expand Up @@ -722,7 +722,7 @@ class CopyBinding<std::list<T>>: public AbstractBinding


template <class T>
class Binding<std::deque<T>>: public AbstractBinding
class Binding<std::deque<T>> final: public AbstractBinding
/// Specialization for std::deque.
{
public:
Expand Down Expand Up @@ -787,7 +787,7 @@ class Binding<std::deque<T>>: public AbstractBinding


template <class T>
class CopyBinding<std::deque<T>>: public AbstractBinding
class CopyBinding<std::deque<T>> final: public AbstractBinding
/// Specialization for std::deque.
{
public:
Expand Down Expand Up @@ -852,7 +852,7 @@ class CopyBinding<std::deque<T>>: public AbstractBinding


template <class T>
class Binding<std::set<T>>: public AbstractBinding
class Binding<std::set<T>> final: public AbstractBinding
/// Specialization for std::set.
{
public:
Expand Down Expand Up @@ -917,7 +917,7 @@ class Binding<std::set<T>>: public AbstractBinding


template <class T>
class CopyBinding<std::set<T>>: public AbstractBinding
class CopyBinding<std::set<T>> final: public AbstractBinding
/// Specialization for std::set.
{
public:
Expand Down Expand Up @@ -982,7 +982,7 @@ class CopyBinding<std::set<T>>: public AbstractBinding


template <class T>
class Binding<std::multiset<T>>: public AbstractBinding
class Binding<std::multiset<T>> final: public AbstractBinding
/// Specialization for std::multiset.
{
public:
Expand Down Expand Up @@ -1047,7 +1047,7 @@ class Binding<std::multiset<T>>: public AbstractBinding


template <class T>
class CopyBinding<std::multiset<T>>: public AbstractBinding
class CopyBinding<std::multiset<T>> final: public AbstractBinding
/// Specialization for std::multiset.
{
public:
Expand Down Expand Up @@ -1112,7 +1112,7 @@ class CopyBinding<std::multiset<T>>: public AbstractBinding


template <class K, class V>
class Binding<std::map<K, V>>: public AbstractBinding
class Binding<std::map<K, V>> final: public AbstractBinding
/// Specialization for std::map.
{
public:
Expand Down Expand Up @@ -1177,7 +1177,7 @@ class Binding<std::map<K, V>>: public AbstractBinding


template <class K, class V>
class CopyBinding<std::map<K, V>>: public AbstractBinding
class CopyBinding<std::map<K, V>> final: public AbstractBinding
/// Specialization for std::map.
{
public:
Expand Down Expand Up @@ -1242,7 +1242,7 @@ class CopyBinding<std::map<K, V>>: public AbstractBinding


template <class K, class V>
class Binding<std::multimap<K, V>>: public AbstractBinding
class Binding<std::multimap<K, V>> final: public AbstractBinding
/// Specialization for std::multimap.
{
public:
Expand Down Expand Up @@ -1307,7 +1307,7 @@ class Binding<std::multimap<K, V>>: public AbstractBinding


template <class K, class V>
class CopyBinding<std::multimap<K, V>>: public AbstractBinding
class CopyBinding<std::multimap<K, V>> final: public AbstractBinding
/// Specialization for std::multimap.
{
public:
Expand Down

0 comments on commit 9141368

Please sign in to comment.