Skip to content

release/19.x: [AA] Take account of C++23's stricter rules for forward declarations (NFC) (#109416) #109476

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

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

llvmbot
Copy link
Member

@llvmbot llvmbot commented Sep 20, 2024

Backport 76bc1ed

Requested by: @nikic

@llvmbot llvmbot added this to the LLVM 19.X Release milestone Sep 20, 2024
@llvmbot
Copy link
Member Author

llvmbot commented Sep 20, 2024

@nikic What do you think about merging this PR to the release branch?

@llvmbot llvmbot requested a review from nikic September 20, 2024 21:02
@llvmbot llvmbot added the llvm:analysis Includes value tracking, cost tables and constant folding label Sep 20, 2024
@llvmbot
Copy link
Member Author

llvmbot commented Sep 20, 2024

@llvm/pr-subscribers-llvm-analysis

Author: None (llvmbot)

Changes

Backport 76bc1ed

Requested by: @nikic


Full diff: https://github.com/llvm/llvm-project/pull/109476.diff

2 Files Affected:

  • (modified) llvm/include/llvm/Analysis/AliasAnalysis.h (+1-1)
  • (modified) llvm/lib/Analysis/AliasAnalysis.cpp (+2)
diff --git a/llvm/include/llvm/Analysis/AliasAnalysis.h b/llvm/include/llvm/Analysis/AliasAnalysis.h
index 4140387a1f3410..1b5a6ee24b8610 100644
--- a/llvm/include/llvm/Analysis/AliasAnalysis.h
+++ b/llvm/include/llvm/Analysis/AliasAnalysis.h
@@ -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();
 
diff --git a/llvm/lib/Analysis/AliasAnalysis.cpp b/llvm/lib/Analysis/AliasAnalysis.cpp
index 6eaaad5f332eb9..9cdb315b6088f3 100644
--- a/llvm/lib/Analysis/AliasAnalysis.cpp
+++ b/llvm/lib/Analysis/AliasAnalysis.cpp
@@ -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)) {}
 

Copy link

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.
See LLVM Discourse for more information.

…(NFC) (llvm#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 llvm#106597.

(cherry picked from commit 76bc1ed)
@tru tru merged commit 38934af into llvm:release/19.x Sep 24, 2024
4 of 10 checks passed
Copy link

@nikic (or anyone else). If you would like to add a note about this fix in the release notes (completely optional). Please reply to this comment with a one or two sentence description of the fix. When you are done, please add the release:note label to this PR.

@nikic
Copy link
Contributor

nikic commented Sep 24, 2024

Made AliasAnalysis.h header compatible with C++23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm:analysis Includes value tracking, cost tables and constant folding release:note
Projects
Development

Successfully merging this pull request may close these issues.

4 participants