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 with gcc 9.3.0 on Ubuntu 20.04 #312

Closed
quicky2000 opened this issue Dec 8, 2020 · 4 comments · May be fixed by #318
Closed

Compilation error with gcc 9.3.0 on Ubuntu 20.04 #312

quicky2000 opened this issue Dec 8, 2020 · 4 comments · May be fixed by #318
Labels

Comments

@quicky2000
Copy link

After cloing the repository and performing cmake
cmake --build <build_dir> failed with the following error:

[ 40%] Building CXX object test/CMakeFiles/test_concurrent_set.dir/tbb/test_concurrent_set.cpp.o
In file included from /media/data/Programmation/C++/build/oneTBB/oneTBB/test/common/concurrent_ordered_common.h:20,
                 from /media/data/Programmation/C++/build/oneTBB/oneTBB/test/tbb/test_concurrent_set.cpp:21:
/media/data/Programmation/C++/build/oneTBB/oneTBB/test/common/concurrent_associative_common.h: In instantiation of ‘void test_scoped_allocator() [with ContainerTraits = COSetTraits]’:
/media/data/Programmation/C++/build/oneTBB/oneTBB/test/tbb/test_concurrent_set.cpp:198:40:   required from here
/media/data/Programmation/C++/build/oneTBB/oneTBB/test/common/concurrent_associative_common.h:1184:8: error: implicitly-declared ‘tbb::detail::d1::concurrent_set<AllocatorAwareData<std::scoped_allocator_adaptor<std::allocator<int> > >, std::less<AllocatorAwareData<std::scoped_allocator_adaptor<std::allocator<int> > > >, std::scoped_allocator_adaptor<std::allocator<AllocatorAwareData<std::scoped_allocator_adaptor<std::allocator<int> > > > > >& tbb::detail::d1::concurrent_set<AllocatorAwareData<std::scoped_allocator_adaptor<std::allocator<int> > >, std::less<AllocatorAwareData<std::scoped_allocator_adaptor<std::allocator<int> > > >, std::scoped_allocator_adaptor<std::allocator<AllocatorAwareData<std::scoped_allocator_adaptor<std::allocator<int> > > > > >::operator=(const tbb::detail::d1::concurrent_set<AllocatorAwareData<std::scoped_allocator_adaptor<std::allocator<int> > >, std::less<AllocatorAwareData<std::scoped_allocator_adaptor<std::allocator<int> > > >, std::scoped_allocator_adaptor<std::allocator<AllocatorAwareData<std::scoped_allocator_adaptor<std::allocator<int> > > > > >&)’ is deprecated [-Werror=deprecated-copy]
 1184 |     c1 = c2;
      |     ~~~^~~~
compilation terminated due to -Wfatal-errors.
@johhnry
Copy link

johhnry commented Dec 16, 2020

Hi,

I can confirm this bug on Pop!_OS 20.10 with gcc (Ubuntu 10.2.0-13ubuntu1) 10.2.0 by running an out of source build.

Lastique added a commit to Lastique/tbb that referenced this issue Dec 16, 2020
This resolves gcc warnings about deprecated in C++11 implicitly generated
assignment operators when user-defined constructors are present. This
is because the constructors are inherited by a user-declaration from
a base class, while there is no operator= inheriting in C++ and the
using declaration for operator= does not prevent the compiler from implicitly
generating the operators.

Since defining the operators then forces the compiler to implicitly define
standard constructors as deleted, we also need to define the constructors as
defaulted. We keep the using declaration for constructors to inherit the
non-standard constructors.

In concurrent_queue, the assignment operator was missing while copy/move
constructors were present and contained non-trivial logic. The implicitly
generated assignment operator would have been incorrect. The added assignment
operator reuses copy/move constructors to implement assignment.

Fixes oneapi-src#312.
@alexey-katranov
Copy link
Contributor

@kboyarinov, can you please follow up on the issue?

@johhnry
Copy link

johhnry commented Jan 5, 2021

Hi, I just compiled successfully on Pop!_OS 20.10 with the last version d86ed7f ! Thanks guys

@kboyarinov
Copy link
Contributor

@quicky2000, @johhnry,

This issue was fixed in oneTBB 2021.2.0.
If you still have any issues, feel free to contact us.

Lastique added a commit to Lastique/tbb that referenced this issue Nov 25, 2021
This fixes incorrect return types of assignment operators imported from
base classes. Other than copy and move assignment operators, which are
generated by the compiler even if imported with a using-declaration,
the imported operators will be returning a reference to the base class
instead of the derived class.

In concurrent_queue, the assignment operator was missing while copy/move
constructors were present and contained non-trivial logic. The implicitly
generated assignment operator would have been incorrect. The added assignment
operator reuses copy/move constructors to implement assignment.

In concurrent_bounded_queue, the assignment operator was also missing and
would have been deleted because of std::atomic member, while the class also
had copy and move constructors. The added assignment operator also reuses
the existing constructors.

Fixes oneapi-src#312.
Fixes oneapi-src#372.
Fixes oneapi-src#373.
Lastique added a commit to Lastique/tbb that referenced this issue Nov 25, 2021
This fixes incorrect return types of assignment operators imported from
base classes. Other than copy and move assignment operators, which are
generated by the compiler even if imported with a using-declaration,
the imported operators will be returning a reference to the base class
instead of the derived class.

In concurrent_queue, the assignment operator was missing while copy/move
constructors were present and contained non-trivial logic. The implicitly
generated assignment operator would have been incorrect. The added assignment
operator reuses copy/move constructors to implement assignment.

In concurrent_bounded_queue, the assignment operator was also missing and
would have been deleted because of std::atomic member, while the class also
had copy and move constructors. The added assignment operator also reuses
the existing constructors.

Fixes oneapi-src#312.
Fixes oneapi-src#372.
Fixes oneapi-src#373.

Signed-off-by: Andrey Semashev <andrey.semashev@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants