diff --git a/include/llvm/ADT/Optional.h b/include/llvm/ADT/Optional.h index 144367d352d..0386e57f05f 100644 --- a/include/llvm/ADT/Optional.h +++ b/include/llvm/ADT/Optional.h @@ -120,7 +120,7 @@ public: T& operator*() LLVM_LVALUE_FUNCTION { assert(hasVal); return *getPointer(); } template - constexpr T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION { + LLVM_CONSTEXPR T getValueOr(U &&value) const LLVM_LVALUE_FUNCTION { return hasValue() ? getValue() : std::forward(value); }