public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix typo in unordered_map deduction guide, missing "typename ="
@ 2017-11-24 17:21 Stephan Bergmann
  2017-11-27 17:03 ` Jonathan Wakely
  0 siblings, 1 reply; 2+ messages in thread
From: Stephan Bergmann @ 2017-11-24 17:21 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 789 bytes --]

Otherwise, at least recent Clang trunk with -std=gnu++17 complains

> In file included from lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/functional:60:
> In file included from lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/unordered_map:47:
> lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/bits/unordered_map.h:1197:5: error: deduction guide template contains a template parameter that cannot be deduced
>     unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
>     ^
> lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/bits/unordered_map.h:1196:34: note: non-deducible template parameter (anonymous)
>            _RequireAllocator<_Allocator>>
>                                         ^
> 1 error generated.


[-- Attachment #2: 0001-Fix-typo-in-unordered_map-deduction-guide-missing-ty.patch --]
[-- Type: text/x-patch, Size: 1761 bytes --]

From 0ecb03c59b9318b3f47e49daa2f45dd513035d55 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Fri, 24 Nov 2017 17:55:38 +0100
Subject: [PATCH] Fix typo in unordered_map deduction guide, missing "typename
 ="

...as correctly appears in all the other deduction guides in these files.
---
 libstdc++-v3/include/bits/unordered_map.h | 2 +-
 libstdc++-v3/include/debug/unordered_map  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libstdc++-v3/include/bits/unordered_map.h b/libstdc++-v3/include/bits/unordered_map.h
index cb5bcb89a16..27c89f172e1 100644
--- a/libstdc++-v3/include/bits/unordered_map.h
+++ b/libstdc++-v3/include/bits/unordered_map.h
@@ -1193,7 +1193,7 @@ _GLIBCXX_BEGIN_NAMESPACE_CONTAINER
     -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
 
   template<typename _Key, typename _Tp, typename _Allocator,
-	   _RequireAllocator<_Allocator>>
+	   typename = _RequireAllocator<_Allocator>>
     unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
     -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
 
diff --git a/libstdc++-v3/include/debug/unordered_map b/libstdc++-v3/include/debug/unordered_map
index c5734304846..c68ccaa3372 100644
--- a/libstdc++-v3/include/debug/unordered_map
+++ b/libstdc++-v3/include/debug/unordered_map
@@ -679,7 +679,7 @@ namespace __debug
     -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
 
   template<typename _Key, typename _Tp, typename _Allocator,
-	   _RequireAllocator<_Allocator>>
+	   typename = _RequireAllocator<_Allocator>>
     unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
     -> unordered_map<_Key, _Tp, hash<_Key>, equal_to<_Key>, _Allocator>;
 
-- 
2.13.6


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix typo in unordered_map deduction guide, missing "typename ="
  2017-11-24 17:21 [PATCH] Fix typo in unordered_map deduction guide, missing "typename =" Stephan Bergmann
@ 2017-11-27 17:03 ` Jonathan Wakely
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2017-11-27 17:03 UTC (permalink / raw)
  To: Stephan Bergmann; +Cc: libstdc++, gcc-patches

On 24/11/17 18:03 +0100, Stephan Bergmann wrote:
>Otherwise, at least recent Clang trunk with -std=gnu++17 complains
>
>>In file included from lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/functional:60:
>>In file included from lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/unordered_map:47:
>>lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/bits/unordered_map.h:1197:5: error: deduction guide template contains a template parameter that cannot be deduced
>>    unordered_map(initializer_list<pair<_Key, _Tp>>, _Allocator)
>>    ^
>>lib/gcc/x86_64-pc-linux-gnu/8.0.0/../../../../include/c++/8.0.0/bits/unordered_map.h:1196:34: note: non-deducible template parameter (anonymous)
>>           _RequireAllocator<_Allocator>>
>>                                        ^
>>1 error generated.
>

Committed to trunk, backport to gcc-7-branch will follow.

I created https://gcc.gnu.org/PR83181 for the accepts-invalid bug. All
our tests pass with or without the fix, and even with that deduction
guide completely deleted, so I don't understand what it's supposed to
be for. This is hardly the only thing I don't understand about
deduction guides.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-11-27 16:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-24 17:21 [PATCH] Fix typo in unordered_map deduction guide, missing "typename =" Stephan Bergmann
2017-11-27 17:03 ` Jonathan Wakely

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).