Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation error in MSVC 2017 with enabled /Zc:__cplusplus flag #274

Closed
osipyonok opened this issue Sep 2, 2020 · 3 comments
Closed

Compilation error in MSVC 2017 with enabled /Zc:__cplusplus flag #274

osipyonok opened this issue Sep 2, 2020 · 3 comments

Comments

@osipyonok
Copy link

osipyonok commented Sep 2, 2020

Hello!

I've got a compilation error in MSVC 2017 with enabled /Zc:__cplusplus flag.
TBB version: TBB 2020 Update 3
Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x64 (141 toolset)
Standard: C++17 (/std:c++17)

Minimal code to reproduce the issue:

#include <tbb/concurrent_vector.h>
int main()
{
	tbb::concurrent_vector<int> vector;
	vector.push_back(1);
	return 0;
}

Build output:

1>c:\libs\tbb\tbb\include\tbb\concurrent_vector.h(680): error C2061: syntax error: identifier 'concurrent_vector<template-type-parameter-1',template-type-parameter-2'>'
1>c:\libs\tbb\tbb\include\tbb\concurrent_vector.h(1167): note: see reference to class template instantiation 'tbb::concurrent_vector<T,A>' being compiled
1>d:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\memory_resource(845): note: see reference to class template instantiation 'std::pmr::_Intrusive_stackstd::pmr::monotonic_buffer_resource::_Header,void' being compiled
1>d:\program files (x86)\microsoft visual studio\2017\community\vc\tools\msvc\14.16.27023\include\memory_resource(465): note: see reference to class template instantiation 'std::pmr::_Intrusive_stackstd::pmr::unsynchronized_pool_resource::_Pool::_Chunk,void' being compiled
1>c:\libs\tbb\tbb\include\tbb\concurrent_vector.h(681): error C2334: unexpected token(s) preceding ':'; skipping apparent function body
1>c:\libs\tbb\tbb\include\tbb\concurrent_vector.h(1167): fatal error C1903: unable to recover from previous error(s); stopping compilation

Without /Zc:__cplusplus option it compiles succesfully. Also it compiles with TBB 2020 Update 1 regardless of the /Zc:__cplusplus flag status.

@Megidd
Copy link

Megidd commented Oct 24, 2020

I can confirm that a fix would be to downgrade to TBB 2020 Update 1 on Windows.

alanb-sony added a commit to alanb-sony/oneTBB that referenced this issue Oct 24, 2020
@alanb-sony
Copy link

You can either apply the fix from #299 or upgrade to visual studio 2019

@anton-potapov
Copy link
Contributor

should work in oneTBB (as the patch applied)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants