[libc] Quiet initializer warnings in getopt

This prevents -Wmissing-braces warnings.

Reviewed By: michaelrj, Caslyn

Differential Revision: https://reviews.llvm.org/D156629
This commit is contained in:
Roland McGrath 2023-07-30 15:10:40 -07:00
parent 5b5bd81b71
commit 0ed4b17707

View File

@ -22,6 +22,9 @@
namespace __llvm_libc {
template <typename T> struct RefWrapper {
RefWrapper() = delete;
constexpr RefWrapper(T *p) : ptr{p} {}
constexpr RefWrapper(const RefWrapper &) = default;
RefWrapper &operator=(const RefWrapper &) = default;
operator T &() { return *ptr; }
T &get() { return *ptr; }