diff --git a/llvm/include/llvm/ADT/PointerUnion.h b/llvm/include/llvm/ADT/PointerUnion.h index 7d4ed02b62262..cdbd76d7f505b 100644 --- a/llvm/include/llvm/ADT/PointerUnion.h +++ b/llvm/include/llvm/ADT/PointerUnion.h @@ -147,12 +147,18 @@ class PointerUnion // isa, cast and the llvm::dyn_cast /// Test if the Union currently holds the type matching T. - template inline bool is() const { return isa(*this); } + template + [[deprecated("Use isa instead")]] + inline bool is() const { + return isa(*this); + } /// Returns the value of the specified pointer type. /// /// If the specified pointer type is incorrect, assert. - template inline T get() const { + template + [[deprecated("Use cast instead")]] + inline T get() const { assert(isa(*this) && "Invalid accessor called"); return cast(*this); }