[AA] Take account of C++23's stricter rules for forward declarations (NFC) (#109416)

C++23 has stricter rules for forward declarations around
std::unique_ptr, this means that the inline declaration of the
constructor was failing under clang in C++23 mode, switching to an
out-of-line definition of the constructor fixes this.

This was fairly major impact as it blocked inclusion of a lot of headers
under clang in C++23 mode.

Fixes #106597.

(cherry picked from commit 76bc1eddb2cf8b6cc073649ade21b59bbed438a2)
This commit is contained in:
Jonathan Tanner 2024-09-20 21:56:40 +01:00 committed by Tobias Hieta
parent a4ace83470
commit 38934af504
2 changed files with 3 additions and 1 deletions

View File

@ -320,7 +320,7 @@ class AAResults {
public:
// Make these results default constructable and movable. We have to spell
// these out because MSVC won't synthesize them.
AAResults(const TargetLibraryInfo &TLI) : TLI(TLI) {}
AAResults(const TargetLibraryInfo &TLI);
AAResults(AAResults &&Arg);
~AAResults();

View File

@ -73,6 +73,8 @@ static cl::opt<bool> EnableAATrace("aa-trace", cl::Hidden, cl::init(false));
static const bool EnableAATrace = false;
#endif
AAResults::AAResults(const TargetLibraryInfo &TLI) : TLI(TLI) {}
AAResults::AAResults(AAResults &&Arg)
: TLI(Arg.TLI), AAs(std::move(Arg.AAs)), AADeps(std::move(Arg.AADeps)) {}