aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorFangrui Song <i@maskray.me>2022-12-17 00:42:05 +0000
committerFangrui Song <i@maskray.me>2022-12-17 00:42:05 +0000
commit21c4dc7997b83e83f87c26a97c104dcdd95f1d0f (patch)
treed206072152eb158d6d0eb6c3b93abca9aeb101c6 /clang/lib/Frontend/CompilerInvocation.cpp
parent2e9c3fe6fcfd7b4672facec87dceb76ff3c83566 (diff)
downloadllvm-21c4dc7997b83e83f87c26a97c104dcdd95f1d0f.zip
llvm-21c4dc7997b83e83f87c26a97c104dcdd95f1d0f.tar.gz
llvm-21c4dc7997b83e83f87c26a97c104dcdd95f1d0f.tar.bz2
std::optional::value => operator*/operator->
value() has undesired exception checking semantics and calls __throw_bad_optional_access in libc++. Moreover, the API is unavailable without _LIBCPP_NO_EXCEPTIONS on older Mach-O platforms (see _LIBCPP_AVAILABILITY_BAD_OPTIONAL_ACCESS). This fixes clang.
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 29a626a..d89a80e 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1990,7 +1990,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
} else {
Opts.DiagnosticsHotnessThreshold = *ResultOrErr;
if ((!Opts.DiagnosticsHotnessThreshold ||
- Opts.DiagnosticsHotnessThreshold.value() > 0) &&
+ *Opts.DiagnosticsHotnessThreshold > 0) &&
!UsingProfile)
Diags.Report(diag::warn_drv_diagnostics_hotness_requires_pgo)
<< "-fdiagnostics-hotness-threshold=";
@@ -2007,7 +2007,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
} else {
Opts.DiagnosticsMisExpectTolerance = *ResultOrErr;
if ((!Opts.DiagnosticsMisExpectTolerance ||
- Opts.DiagnosticsMisExpectTolerance.value() > 0) &&
+ *Opts.DiagnosticsMisExpectTolerance > 0) &&
!UsingProfile)
Diags.Report(diag::warn_drv_diagnostics_misexpect_requires_pgo)
<< "-fdiagnostics-misexpect-tolerance=";