From 490a091fa7397e34b04e72634c3d37d8a4e223a4 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 17 Dec 2019 16:45:19 -0500 Subject: [PATCH] * name-lookup.c (get_std_name_hint): Add std::byte. From-SVN: r279471 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/name-lookup.c | 2 ++ gcc/testsuite/g++.dg/lookup/missing-std-include-9.C | 3 +++ 3 files changed, 9 insertions(+) create mode 100644 gcc/testsuite/g++.dg/lookup/missing-std-include-9.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6b5849e45b3..e8a94f463e5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2019-12-17 Jason Merrill + + * name-lookup.c (get_std_name_hint): Add std::byte. + 2019-12-17 Jakub Jelinek PR c++/59655 diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c index e64cd9a9d66..181dad0e2f2 100644 --- a/gcc/cp/name-lookup.c +++ b/gcc/cp/name-lookup.c @@ -5641,6 +5641,8 @@ get_std_name_hint (const char *name) /* . */ {"condition_variable", "", cxx11}, {"condition_variable_any", "", cxx11}, + /* . */ + {"byte", "", cxx17}, /* . */ {"deque", "", cxx98}, /* . */ 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 index 00000000000..f8e1e1dd8a7 --- /dev/null +++ b/gcc/testsuite/g++.dg/lookup/missing-std-include-9.C @@ -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 } -- 2.30.2