Handle std::get<T>(...) for std::tuple<>

llvm-svn: 274422
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 4f905b8daaf9826b91abe30fe8b5c5cd1ee7caa9
diff --git a/include/tuple b/include/tuple
index 32f4380..b0ab1c9 100644
--- a/include/tuple
+++ b/include/tuple
@@ -1013,6 +1013,11 @@
     static_assert(value != __ambiguous,"type occurs more than once in type list");
 };
 
+template <class _T1>
+struct __find_exactly_one_checked<_T1> {
+    static_assert(!is_same<_T1, _T1>::value, "type not in empty type list");
+};
+
 } // namespace __find_detail;
 
 template <typename _T1, typename... _Args>
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
index 6375b77..74e6efd 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
@@ -20,6 +20,9 @@
     (void)std::get<long>(t1); // expected-note {{requested here}}
     (void)std::get<char>(t1); // expected-note {{requested here}}
         // expected-error@tuple:* 2 {{type occurs more than once}}
+    std::tuple<> t0;
+    (void)std::get<char*>(t0); // expected-node {{requested here}}
+        // expected-error@tuple:* 1 {{type not in empty type list}}
 }
 
 void test_bad_return_type() {