Skip to content

<future>: Emits warnings when compiling with /we5204 #945

Description

Describe the bug
Recent versions of MSVC provide a disabled by default warning /we5204, which flags classes with virtual functions but no virtual destructors. When enabling this warning across our code base, we had to suppress errors coming for <future>, it would be nice
if these could be fixed / suppressed internally to allow the warning to be used cleanly in user code bases.

Command-line test case

C:\Temp>type repro.cpp

#include <future>

int main()
{
    return 0;
}

C:\Temp>CL.exe repro.cpp /EHsc /we5204
Microsoft (R) C/C++ Optimizing Compiler Version 19.26.28806 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

repo.cpp
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.26.28801\include\pplwin.h(78): 
error C5204: 'Concurrency::details::_DefaultPPLTaskScheduler': 
class has virtual functions, but its trivial destructor is not virtual;
instances of objects derived from this class may not be destructed correctly

Expected behavior
I expect to be able to compile code using <future> and /we5204 and not have <future> or any other STL header emit a warning.

STL version
Microsoft Visual Studio Enterprise 2019
Version 16.6.2

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingresolvedSuccessfully resolved without a commit

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions