OSDN Git Service

[OpenMP][Libomptarget] Remove possible harmful copy constructor call for RTLsTy
authorAtmn Patel <atmndp@gmail.com>
Mon, 1 Feb 2021 00:18:41 +0000 (19:18 -0500)
committerAtmn Patel <atmndp@gmail.com>
Wed, 3 Feb 2021 03:04:20 +0000 (22:04 -0500)
commitc0097c784179e6f927ed8ae6b28796faee2fea61
tree44306c19cb864b34e8a558c50a5738394c3ec41e
parent0db882a0f59afcd7f76d716ca2e04f2d6d92aa03
[OpenMP][Libomptarget] Remove possible harmful copy constructor call for RTLsTy

From https://bugs.llvm.org/show_bug.cgi?id=48973, we know that
`std::call_once(PM->RTLs.initFlag, &RTLsTy::LoadRTLs, PM->RTLs)` causes compile
time problems in libstdc++v3 5.3.1. This is because there was a defect in the
standard regarding the `call_once` (LWG 2442). This was fixed in libstdc++ soon
thereafter, but there are likely other standard libraries where this will fail.

By matching this function call with the other one, we fix this bug.

Differential Revision: https://reviews.llvm.org/D95769
openmp/libomptarget/src/interface.cpp