[PATCH] D138623: [ADT] Deprecate llvm::NoneType
Fangrui Song via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 23 16:00:44 PST 2022
MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.
LGTM. `using` can be used as well, but the attribute is at a different place.
MSVC supports this for using/typedef but it doesn't warn about function arguments ([Facepalm]). g++/clang++ are good.
using NoneType [[depercated("xxx")]] = std::nullopt_t;
[[depercated("xxx")]] typedef std::nullopt_t NoneType2;
void foo(NoneType a) {}
void foo2(NoneType2 a) {}
void use() {
foo(std::nullopt);
foo2(std::nullopt);
}
================
Comment at: llvm/include/llvm/ADT/None.h:25
/// and similar types without having to spell out the specialization's name.
-using NoneType = std::nullopt_t;
+LLVM_DEPRECATED("Use std::noneopt_t instead.", "std::nullopt_t")
+typedef std::nullopt_t NoneType;
----------------
typo: `std::nullopt_t`
I think the period can be omitted.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D138623/new/
https://reviews.llvm.org/D138623
More information about the llvm-commits
mailing list