summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorAdrian Vogelsgesang <avogelsgesang@salesforce.com>2023-05-04 12:20:29 +0000
committerAdrian Vogelsgesang <avogelsgesang@salesforce.com>2023-05-11 22:21:36 +0000
commit687bd77e2c26487cba727aacfa7067dd01286be0 (patch)
tree415b2ba6fcce467ff6254e615adb4aaf9909b323 /utils
parentb10e9427b96e6bfb242853e9e8cfbb5031890a89 (diff)
downloadllvm-687bd77e2c26487cba727aacfa7067dd01286be0.tar.gz
[ADT][NFC] Fix compilation of headers under C++23
`DoubleAPFloat` has a `unique_ptr<APFloat[]>` member. In `DoubleAPFloat::operator=` and `DoubleAPFloat::get{First,Second}`, the methods of this unique_ptr are getting instantiated. At that point `APFloat` is still only a forward declaration. This triggers undefined behavior. So far, we were probaly just lucky and the code compiled fine. However, with C++23 `std::unique_ptr` became constexpr, and clang (and other compilers) are now diagnosing this latent bug as an error. This commit fixes the issue by moving the function definitions out of the class definition of `DoubleAPFloat`, after the declaration of `APFloat`. A similar issue exists in `ModuleSummaryIndex.h`, the fix is pretty much identical. Fixes #59784 Differential Revision: https://reviews.llvm.org/D149854
Diffstat (limited to 'utils')
0 files changed, 0 insertions, 0 deletions