* [C++ PATCH] * name-lookup.c (get_std_name_hint): Add std::byte.
@ 2019-12-17 21:46 Jason Merrill
0 siblings, 0 replies; only message in thread
From: Jason Merrill @ 2019-12-17 21:46 UTC (permalink / raw)
To: gcc-patches
I noticed we didn't have a hint for std::byte yet.
Tested x86_64-pc-linux-gnu, applying to trunk.
---
gcc/cp/name-lookup.c | 2 ++
gcc/testsuite/g++.dg/lookup/missing-std-include-9.C | 3 +++
2 files changed, 5 insertions(+)
create mode 100644 gcc/testsuite/g++.dg/lookup/missing-std-include-9.C
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>. */
{"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
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 }
base-commit: ada5a6defe4bb8a68098bed51d0f22fc78d7efbc
--
2.18.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2019-12-17 21:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-17 21:46 [C++ PATCH] * name-lookup.c (get_std_name_hint): Add std::byte Jason Merrill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).