diff --git a/lib/bap_llvm/llvm_disasm.cpp b/lib/bap_llvm/llvm_disasm.cpp index 41f9bb64f..055f3ce7d 100644 --- a/lib/bap_llvm/llvm_disasm.cpp +++ b/lib/bap_llvm/llvm_disasm.cpp @@ -652,7 +652,8 @@ struct create_llvm_disassembler : disasm_factory { static void parse_environment_options(const char *prog_name, const char *env_var) { #if LLVM_VERSION_MAJOR >= 12 - llvm::Optional env_value = llvm::sys::Process::GetEnv(llvm::StringRef(env_var)); + // auto is llvm::Optional or std::optional + const auto& env_value = llvm::sys::Process::GetEnv(llvm::StringRef(env_var)); if (!env_value) return;