You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #275, we learned that certain ATL interface classes use __declspec(novtable) which stops the compiler from installing vftables. This causes problems with reasonNOTConstructor_G, and probably other rules as well.
How should we fix this? One option might be to hard-code a list of classes to block for reasonNOTConstructor_G. For example, in #275, that would be CScrollView. CScrollView does have a vftable, but its parent, CView, does not. We can use RTTI to identify the installation of CScrollView's vftable, and from there block it.
But this only works because CScrollView does not have __declspec(novtable). It definitely could though, as it is an abstract class. So this technique might not work universally.
The text was updated successfully, but these errors were encountered:
In #275, we learned that certain ATL interface classes use
__declspec(novtable)
which stops the compiler from installing vftables. This causes problems withreasonNOTConstructor_G
, and probably other rules as well.This can be observed in https://github.com/edmcman/MFCApplication/blob/master/Release/MFCApplication.exe at
CView::CView
which does not install a vftable.How should we fix this? One option might be to hard-code a list of classes to block for
reasonNOTConstructor_G
. For example, in #275, that would beCScrollView
.CScrollView
does have a vftable, but its parent,CView
, does not. We can use RTTI to identify the installation ofCScrollView
's vftable, and from there block it.But this only works because CScrollView does not have
__declspec(novtable)
. It definitely could though, as it is an abstract class. So this technique might not work universally.The text was updated successfully, but these errors were encountered: