Skip to content

Commit 0ed4b17

Browse files
committed
[libc] Quiet initializer warnings in getopt
This prevents -Wmissing-braces warnings. Reviewed By: michaelrj, Caslyn Differential Revision: https://reviews.llvm.org/D156629
1 parent 5b5bd81 commit 0ed4b17

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

libc/src/unistd/getopt.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
namespace __llvm_libc {
2323

2424
template <typename T> struct RefWrapper {
25+
RefWrapper() = delete;
26+
constexpr RefWrapper(T *p) : ptr{p} {}
27+
constexpr RefWrapper(const RefWrapper &) = default;
2528
RefWrapper &operator=(const RefWrapper &) = default;
2629
operator T &() { return *ptr; }
2730
T &get() { return *ptr; }

0 commit comments

Comments
 (0)