public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/54948] template unnecessarily displayed as "A< template-parameter-1-1 >" not "A<T>"
Date: Sat, 20 Apr 2013 12:03:00 -0000	[thread overview]
Message-ID: <bug-54948-4-LImuTzZrba@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-54948-4@http.gcc.gnu.org/bugzilla/>


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54948

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2013-04-20 12:03:29 UTC ---
There are several "bugs" in this case. The first one is that we consider that
the type of:

template<typename> struct A

is "struct A< <template-parameter-1-1> >". It would be nicer to print something
like "struct A<typename>" or "struct A<>". Clang never needs to print made up
names.

The second bug is that I think we record T when parsing, but later we drop it.
I wasn't able to find when we drop it. There is a lot going on between the
moment we parse T and the moment we parse {, so it is rather difficult to
figure out. Stepping in the parser is rather frustrating.

I am afraid that the only person that may know what is going or where to look
is Jason. There is lookup_template_class, but by the time we call it, we
already dropped T (or so it seems to me, maybe it is recorded somewhere else).
>From gcc-bugs-return-420647-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Apr 20 12:06:13 2013
Return-Path: <gcc-bugs-return-420647-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 8678 invoked by alias); 20 Apr 2013 12:06:13 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 8633 invoked by uid 48); 20 Apr 2013 12:06:10 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/54948] template unnecessarily displayed as "A< template-parameter-1-1 >" not "A<T>"
Date: Sat, 20 Apr 2013 12:06:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields:
Message-ID: <bug-54948-4-YeetVUoGo8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-54948-4@http.gcc.gnu.org/bugzilla/>
References: <bug-54948-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg01792.txt.bz2
Content-length: 300


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54948

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2013-04-20 12:06:10 UTC ---
BTW, the parser may benefit by marking some functions with "skip" to help
debugging. All the cp_lexer_peek_* are useless to step into.
>From gcc-bugs-return-420648-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Apr 20 12:28:35 2013
Return-Path: <gcc-bugs-return-420648-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17843 invoked by alias); 20 Apr 2013 12:28:35 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 17816 invoked by uid 48); 20 Apr 2013 12:28:31 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/57012] New: pretty-printer does not handle well template parameter packs
Date: Sat, 20 Apr 2013 12:28:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Changed-Fields:
Message-ID: <bug-57012-4@http.gcc.gnu.org/bugzilla/>
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
Content-Type: text/plain; charset="UTF-8"
MIME-Version: 1.0
X-SW-Source: 2013-04/txt/msg01793.txt.bz2
Content-length: 1768


http://gcc.gnu.org/bugzilla/show_bug.cgi?idW012

             Bug #: 57012
           Summary: pretty-printer does not handle well template parameter
                    packs
    Classification: Unclassified
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: manu@gcc.gnu.org


/home/manuel/test3/src/gcc/testsuite/g++.dg/cpp0x/pr31432.C:2:40: error:
parameter pack '<template-parameter-1-1>' must be at the end of the template
parameter list
/home/manuel/test3/src/gcc/testsuite/g++.dg/cpp0x/pr31432.C:7:11: error:
type/value mismatch at argument 1 in template parameter list for
'template<<declaration error>, class> struct A'
/home/manuel/test3/src/gcc/testsuite/g++.dg/cpp0x/pr31432.C:7:11: error:
expected a constant of type '<type error>', got 'int'
/home/manuel/test3/src/gcc/testsuite/g++.dg/cpp0x/pr31432.C:7:14: error:
invalid type in declaration before ';' token
/home/manuel/test3/src/gcc/testsuite/g++.dg/cpp0x/pr31432.C:8:11: error:
type/value mismatch at argument 1 in template parameter list for
'template<<declaration error>, class> struct A'
/home/manuel/test3/src/gcc/testsuite/g++.dg/cpp0x/pr31432.C:8:11: error:
expected a constant of type '<type error>', got 'char'
/home/manuel/test3/src/gcc/testsuite/g++.dg/cpp0x/pr31432.C:8:14: error:
invalid type in declaration before ';' token

Clang++ by comparison:

/home/manuel/test3/src/gcc/testsuite/g++.dg/cpp0x/pr31432.C:2:10: error:
template parameter pack must be the last template parameter
template<typename..., typename> struct A // { dg-error "parameter pack" }
         ^


  reply	other threads:[~2013-04-20 12:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-17 13:25 [Bug c++/54948] New: " redi at gcc dot gnu.org
2013-04-20 12:03 ` manu at gcc dot gnu.org [this message]
2022-01-18 13:24 ` [Bug c++/54948] " redi 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-54948-4-LImuTzZrba@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).