Re: [PATCH 2/2] Add more entries to the C++ get_std_name_hint array

2019-08-14 Thread Jonathan Wakely

On 13/08/19 16:08 -0400, Jason Merrill wrote:

On 8/13/19 9:36 AM, Jonathan Wakely wrote:

This adds some commonly-used C++11/14 names, and some new C++17/20
names. The latter aren't available when using the -std=gnu++14
default, so the fix-it suggesting to use a newer dialect is helpful.

* name-lookup.c (get_std_name_hint): Add more entries.

Tested x86_64-linux. OK for trunk?


OK.


I realised as I was about to commit it that cxx17 is the wrong dialect
for remove_cvref and remove_cvref_t, so I corrected them to cxx2a
before committing it.

(I've tried to use remove_cvref_t in C++17 a few times, so this
diagnostic should help me!)



Re: [PATCH 2/2] Add more entries to the C++ get_std_name_hint array

2019-08-13 Thread Jason Merrill

On 8/13/19 9:36 AM, Jonathan Wakely wrote:

This adds some commonly-used C++11/14 names, and some new C++17/20
names. The latter aren't available when using the -std=gnu++14
default, so the fix-it suggesting to use a newer dialect is helpful.

 * name-lookup.c (get_std_name_hint): Add more entries.

Tested x86_64-linux. OK for trunk?


OK.

Jason



[PATCH 2/2] Add more entries to the C++ get_std_name_hint array

2019-08-13 Thread Jonathan Wakely

This adds some commonly-used C++11/14 names, and some new C++17/20
names. The latter aren't available when using the -std=gnu++14
default, so the fix-it suggesting to use a newer dialect is helpful.

* name-lookup.c (get_std_name_hint): Add more entries.

Tested x86_64-linux. OK for trunk?

commit 0c12d092e5659689951b5e134b84c5b506b543d5
Author: Jonathan Wakely 
Date:   Tue Aug 13 13:42:40 2019 +0100

Add more entries to the C++ get_std_name_hint array

* name-lookup.c (get_std_name_hint): Add more entries.

diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index 96b2d90540d..68ebd7655c7 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -5550,9 +5550,11 @@ get_std_name_hint (const char *name)
 {"make_any", "", cxx17},
 /* .  */
 {"array", "", cxx11},
+{"to_array", "", cxx2a},
 /* .  */
 {"atomic", "", cxx11},
 {"atomic_flag", "", cxx11},
+{"atomic_ref", "", cxx2a},
 /* .  */
 {"bitset", "", cxx11},
 /* .  */
@@ -5575,9 +5577,17 @@ get_std_name_hint (const char *name)
 {"ofstream", "", cxx98},
 /* .  */
 {"bind", "", cxx11},
+{"bind_front", "", cxx2a},
 {"function", "", cxx11},
 {"hash", "", cxx11},
+{"invoke", "", cxx17},
 {"mem_fn", "", cxx11},
+{"not_fn", "", cxx17},
+{"reference_wrapper", "", cxx11},
+{"unwrap_reference", "", cxx2a},
+{"unwrap_reference_t", "", cxx2a},
+{"unwrap_ref_decay", "", cxx2a},
+{"unwrap_ref_decay_t", "", cxx2a},
 /* . */
 {"async", "", cxx11},
 {"future", "", cxx11},
@@ -5618,11 +5628,16 @@ get_std_name_hint (const char *name)
 {"map", "", cxx98},
 {"multimap", "", cxx98},
 /* .  */
+{"allocate_shared", "", cxx11},
+{"allocator", "", cxx98},
+{"allocator_traits", "", cxx11},
 {"make_shared", "", cxx11},
 {"make_unique", "", cxx14},
 {"shared_ptr", "", cxx11},
 {"unique_ptr", "", cxx11},
 {"weak_ptr", "", cxx11},
+/* .  */
+{"pmr", "", cxx17},
 /* .  */
 {"mutex", "", cxx11},
 {"timed_mutex", "", cxx11},
@@ -5672,14 +5687,39 @@ get_std_name_hint (const char *name)
 {"u16string", "", cxx11},
 {"u32string", "", cxx11},
 /* .  */
+{"basic_string_view", "", cxx17},
 {"string_view", "", cxx17},
 /* .  */
 {"thread", "", cxx11},
+{"this_thread", "", cxx11},
 /* .  */
+{"apply", "", cxx17},
+{"forward_as_tuple", "", cxx11},
+{"make_from_tuple", "", cxx17},
 {"make_tuple", "", cxx11},
+{"tie", "", cxx11},
 {"tuple", "", cxx11},
+{"tuple_cat", "", cxx11},
 {"tuple_element", "", cxx11},
+{"tuple_element_t", "", cxx14},
 {"tuple_size", "", cxx11},
+{"tuple_size_v", "", cxx17},
+/* .  */
+{"enable_if", "", cxx11},
+{"enable_if_t", "", cxx14},
+{"invoke_result", "", cxx17},
+{"invoke_result_t", "", cxx17},
+{"remove_cvref", "", cxx17},
+{"remove_cvref_t", "", cxx17},
+{"type_identity", "", cxx2a},
+{"type_identity_t", "", cxx2a},
+{"void_t", "", cxx17},
+{"conjunction", "", cxx17},
+{"conjunction_v", "", cxx17},
+{"disjunction", "", cxx17},
+{"disjunction_v", "", cxx17},
+{"negation", "", cxx17},
+{"negation_v", "", cxx17},
 /* .  */
 {"unordered_map", "", cxx11},
 {"unordered_multimap", "", cxx11},