public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99076] New: Unclear error message when trailing angle bracket is missing
@ 2021-02-11 21:13 bugzilla@poradnik-webmastera.com
  2021-02-11 21:28 ` [Bug c++/99076] " mpolacek at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: bugzilla@poradnik-webmastera.com @ 2021-02-11 21:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99076

            Bug ID: 99076
           Summary: Unclear error message when trailing angle bracket is
                    missing
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugzilla@poradnik-webmastera.com
  Target Milestone: ---

[code]
#include <memory>
#include <map>

template<
    typename Key,
    typename T,
    typename Compare = std::less<Key>,
    typename Allocator = std::allocator<std::pair<const Key, T>> >
using SecureMemMap = std::map<Key, T, Compare, std::allocator<std::pair<const
Key, T>>;
[/code]

When this is compiled using g++, it gives following error message:

[out]
<source>:9:53: error: template argument 4 is invalid
    9 | using SecureMemMap = std::map<Key, T, Compare,
std::allocator<std::pair<const Key, T>>;
      | 
[/out]

Above message is not very helpful, it is hard to tell what is wrong here.
clang++ does better job here. Please improve g++ message in a similar way:

[out]
<source>:9:87: error: expected '>'
using SecureMemMap = std::map<Key, T, Compare, std::allocator<std::pair<const
Key, T>>;
                                                                               
      ^
<source>:9:30: note: to match this '<'
using SecureMemMap = std::map<Key, T, Compare, std::allocator<std::pair<const
Key, T>>;
                             ^
[/out]

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

* [Bug c++/99076] Unclear error message when trailing angle bracket is missing
  2021-02-11 21:13 [Bug c++/99076] New: Unclear error message when trailing angle bracket is missing bugzilla@poradnik-webmastera.com
@ 2021-02-11 21:28 ` mpolacek at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-11 21:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99076

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2021-02-11
     Ever confirmed|0                           |1
           Keywords|                            |diagnostic
                 CC|                            |mpolacek at gcc dot gnu.org

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

end of thread, other threads:[~2021-02-11 21:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-11 21:13 [Bug c++/99076] New: Unclear error message when trailing angle bracket is missing bugzilla@poradnik-webmastera.com
2021-02-11 21:28 ` [Bug c++/99076] " mpolacek at gcc dot gnu.org

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