Skip to content

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

@osipyonok

Description

@osipyonok

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions