diff options
author | cor3ntin <corentinjabot@gmail.com> | 2025-06-03 14:22:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-03 14:22:54 +0200 |
commit | c9968f4a04e055353f0667a16bcf34f1b3d855a5 (patch) | |
tree | ba967ced23066d241a59260ad270c3f2f416ec18 /clang/lib/Sema/SemaExceptionSpec.cpp | |
parent | ec96c0c072ef3f78813c378949c00e1c07aa44e5 (diff) | |
download | llvm-c9968f4a04e055353f0667a16bcf34f1b3d855a5.zip llvm-c9968f4a04e055353f0667a16bcf34f1b3d855a5.tar.gz llvm-c9968f4a04e055353f0667a16bcf34f1b3d855a5.tar.bz2 |
[Clang] Improve infrastructure for libstdc++ workarounds (Reland) (#142592)
Reland with debug traces to try to understand a bug that only happens on
one CI configuration
===
This introduces a way detect the libstdc++ version,
use that to enable workarounds.
The version is cached.
This should make it easier in the future to find and remove
these hacks.
I did not find the need for enabling a hack between or after
specific versions, so it's left as a future exercise.
We can extend this fature to other libraries as the need arise.
===
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index c83eab5..c692f82 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -18,6 +18,7 @@ #include "clang/AST/TypeLoc.h" #include "clang/Basic/Diagnostic.h" #include "clang/Basic/SourceManager.h" +#include "clang/Lex/Preprocessor.h" #include "clang/Sema/SemaInternal.h" #include "llvm/ADT/SmallPtrSet.h" #include <optional> @@ -44,6 +45,8 @@ static const FunctionProtoType *GetUnderlyingFunction(QualType T) bool Sema::isLibstdcxxEagerExceptionSpecHack(const Declarator &D) { auto *RD = dyn_cast<CXXRecordDecl>(CurContext); + if (!getPreprocessor().NeedsStdLibCxxWorkaroundBefore(2016'04'27)) + return false; // All the problem cases are member functions named "swap" within class // templates declared directly within namespace std or std::__debug or // std::__profile. |