aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanak@gmail.com>2025-01-28 18:59:05 -0800
committerGitHub <noreply@github.com>2025-01-28 18:59:05 -0800
commit60927405f5612158ae0419798838be45a1637911 (patch)
tree326ec24209ce092b0638da1590ab1e1cef07f41b /clang/lib/Frontend/CompilerInvocation.cpp
parentd0052ebbe2e2f691ec42cad3c8613ef387abc53f (diff)
downloadllvm-60927405f5612158ae0419798838be45a1637911.zip
llvm-60927405f5612158ae0419798838be45a1637911.tar.gz
llvm-60927405f5612158ae0419798838be45a1637911.tar.bz2
Don't use CLANG_VERSION_MAJOR to check that the value passed to -fclang-abi-compat= is valid (#123998)
Use LLVM_VERSION_MAJOR instead as the maximum allowed value. This change is needed to fix regression tests that fail when vendors set CLANG_VERSION_MAJOR to a value that is lower than LLVM_VERSION_MAJOR when building the compiler. For example, clang/test/CodeGenCXX/mangle-concept.cpp fails with the following error if -DCLANG_VERSION_MAJOR=17 is passed to cmake: invalid value '19' in '-fclang-abi-compat=19'
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 44dd699..2097a83 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -4413,7 +4413,7 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args,
// y or y.0 (4 <= y <= current version).
if (!VerParts.first.starts_with("0") &&
!VerParts.first.getAsInteger(10, Major) && 3 <= Major &&
- Major <= CLANG_VERSION_MAJOR &&
+ Major <= MAX_CLANG_ABI_COMPAT_VERSION &&
(Major == 3
? VerParts.second.size() == 1 &&
!VerParts.second.getAsInteger(10, Minor)