public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bugzilla@poradnik-webmastera.com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/99076] New: Unclear error message when trailing angle bracket is missing
Date: Thu, 11 Feb 2021 21:13:58 +0000	[thread overview]
Message-ID: <bug-99076-4@http.gcc.gnu.org/bugzilla/> (raw)

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]

             reply	other threads:[~2021-02-11 21:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-11 21:13 bugzilla@poradnik-webmastera.com [this message]
2021-02-11 21:28 ` [Bug c++/99076] " mpolacek at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-99076-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).