* name-lookup.c (get_std_name_hint): Add std::byte.
authorJason Merrill <jason@redhat.com>
Tue, 17 Dec 2019 21:45:19 +0000 (16:45 -0500)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 17 Dec 2019 21:45:19 +0000 (16:45 -0500)
From-SVN: r279471

gcc/cp/ChangeLog
gcc/cp/name-lookup.c
gcc/testsuite/g++.dg/lookup/missing-std-include-9.C [new file with mode: 0644]

index 6b5849e..e8a94f4 100644 (file)
@@ -1,3 +1,7 @@
+2019-12-17  Jason Merrill  <jason@redhat.com>
+
+       * name-lookup.c (get_std_name_hint): Add std::byte.
+
 2019-12-17  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/59655
index e64cd9a..181dad0 100644 (file)
@@ -5641,6 +5641,8 @@ get_std_name_hint (const char *name)
     /* <condition_variable>. */
     {"condition_variable", "<condition_variable>", cxx11},
     {"condition_variable_any", "<condition_variable>", cxx11},
+    /* <cstddef>.  */
+    {"byte", "<cstddef>", cxx17},
     /* <deque>.  */
     {"deque", "<deque>", cxx98},
     /* <forward_list>.  */
diff --git a/gcc/testsuite/g++.dg/lookup/missing-std-include-9.C b/gcc/testsuite/g++.dg/lookup/missing-std-include-9.C
new file mode 100644 (file)
index 0000000..f8e1e1d
--- /dev/null
@@ -0,0 +1,3 @@
+std::byte b;            // { dg-error "byte" }
+// { dg-message "cstddef" "" { target c++17 } .-1 }
+// { dg-message "C..17" "" { target c++14_down } .-2 }