Skip to content

<execution>: Including with /clr enabled results in compiler error. #955

@AlexGuteniev

Description

@AlexGuteniev

Describe the bug
Including <execution> and compiling with /clr emits a lot of compiler errors.

Command-line test case

d:\Temp2>type repro.cpp
#include <execution>

int main() {}

d:\Temp2>cl /clr /std:c++17 repro.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29009.1
for Microsoft (R) .NET Framework version 4.08.4084.0
Copyright (C) Microsoft Corporation.  All rights reserved.

repro.cpp
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(401): error C3646: '_Mtx': unknown override specifier
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(428): note: see reference to class template instantiation 'std::_Parallel_choose_min_chunk<_Ty>' being compiled
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(401): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(436): error C3646: '_Mtx': unknown override specifier
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(463): note: see reference to class template instantiation 'std::_Parallel_choose_max_chunk<_Ty>' being compiled
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(436): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(647): error C3646: '_Segment_lock': unknown override specifier
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(648): note: see reference to class template instantiation 'std::_Work_stealing_deque<_Ty>' being compiled
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(647): error C2059: syntax error: '{'
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(647): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(749): error C3646: '_Available_mutex': unknown override specifier
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(751): note: see reference to class template instantiation 'std::_Work_stealing_team<_Ty>' being compiled
c:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29009\include\execution(749): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Expected behavior
Either program compiles, or a short error message is emitted.
Depending on whether it is expected to compile,
(Generic issue for this question is #838 , but a specific answer should be enough)

STL version

Microsoft Visual Studio Professional 2019 Preview
Version 16.7.0 Preview 3.1

Additional context
This item is also tracked on Developer Community as DevCom-642475 and by Microsoft-internal VSO-947547 / AB#947547.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions