Cryptopp: VS2015 and multiple C4589 warnings, "Constructor of abstract class X ignores initializer for virtual base class Y"

Created on 4 Jul 2016  路  5Comments  路  Source: weidai11/cryptopp

Using Visual C++ 2015 stand alone toolchain and cryptest.nmake:

        cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapif
amily.h /c wait.cpp
wait.cpp
c:\users\jeff\desktop\cryptopp\wait.h(152): warning C4589: Constructor of abstra
ct class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base clas
s 'CryptoPP::Tracer'
c:\users\jeff\desktop\cryptopp\wait.h(152): note: virtual base classes are only
initialized by the most-derived type
...

        cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapif
amily.h /c network.cpp
network.cpp
c:\users\jeff\desktop\cryptopp\wait.h(152): warning C4589: Constructor of abstra
ct class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base clas
s 'CryptoPP::Tracer'
c:\users\jeff\desktop\cryptopp\wait.h(152): note: virtual base classes are only
initialized by the most-derived type
...

        cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapif
amily.h /c socketft.cpp
socketft.cpp
c:\users\jeff\desktop\cryptopp\wait.h(152): warning C4589: Constructor of abstra
ct class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base clas
s 'CryptoPP::Tracer'
c:\users\jeff\desktop\cryptopp\wait.h(152): note: virtual base classes are only
initialized by the most-derived type
...

        cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapif
amily.h /c winpipes.cpp
winpipes.cpp
c:\users\jeff\desktop\cryptopp\wait.h(152): warning C4589: Constructor of abstra
ct class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base clas
s 'CryptoPP::Tracer'
c:\users\jeff\desktop\cryptopp\wait.h(152): note: virtual base classes are only
initialized by the most-derived type
...

        cl.exe /nologo /W4 /D_MBCS /Zi /TP /EHsc /MD /FI sdkddkver.h /FI winapif
amily.h /c test.cpp
test.cpp
c:\users\jeff\desktop\cryptopp\wait.h(152): warning C4589: Constructor of abstra
ct class 'CryptoPP::WaitObjectsTracer' ignores initializer for virtual base clas
s 'CryptoPP::Tracer'
c:\users\jeff\desktop\cryptopp\wait.h(152): note: virtual base classes are only
initialized by the most-derived type
Enhancement Visual Studio Windows windows-store

Most helpful comment

I do not see this fixed in VS 2015 Update 2

All 5 comments

According to False warning C4589: Constructor of abstract class 'Class2' ignores initializer for virtual base class 'Class1':

Thank you for reporting this issue; it will be fixed in the Update 1 release of VS2015.

It's far from ideal, but besides disabling the warning or defining Derived's copy and/or move constructors as deleted, the workaround is to explicitly define copy and/or move constructors for Derived that don't initialize Base.

It also appears the issue was not fixed in Update 1.

I do not see this fixed in VS 2015 Update 2

The same warning is still produced in VS2017RC. At https://connect.microsoft.com/VisualStudio/feedback/details/1570496/ the issue has been closed as fixed a long time ago. Someone who clearly understands the nature of this issue should report it to Microsoft again on https://connect.microsoft.com/VisualStudio/feedback.

@vidanovic, @PowerGamer1,

This came up again on the mailing list. It appears the issue is still present in VS2017. Also see cryptopp-565 unclean build with VS2015 cryptopp/wait.h.

Does anyone know how to clear the issue once and for all?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mouse07410 picture mouse07410  路  10Comments

MarcelRaad picture MarcelRaad  路  12Comments

guidovranken picture guidovranken  路  8Comments

ISmileYouCryYouSmileIDie picture ISmileYouCryYouSmileIDie  路  6Comments

noloader picture noloader  路  9Comments