public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/57014] pretty-printer prints anonymous for template-parameter with a name
       [not found] <bug-57014-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-10 11:02 ` redi at gcc dot gnu.org
  2021-08-12 12:07 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2021-08-10 11:02 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-08-10

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Confirmed. Here's the relevant code:

template<int> struct B
{
  void F2(int, int, int = 0);
};

template<int N> void B<N>::F2(int = 0, int, int) {}



57014.C:6:22: error: redeclaration of ‘void B<<anonymous> >::F2(int, int, int)’
may not have default arguments [-fpermissive]
    6 | template<int N> void B<N>::F2(int = 0, int, int) {}
      |                      ^~~~
57014.C:6:40: error: default argument missing for parameter 2 of ‘void
B<<anonymous> >::F2(int, int, int)’
    6 | template<int N> void B<N>::F2(int = 0, int, int) {}
      |                                        ^~~
57014.C:6:31: note: ...following parameter 1 which has a default argument
    6 | template<int N> void B<N>::F2(int = 0, int, int) {}
      |                               ^~~~~~~


It would be nice if later declarations that name a template parameter could be
used to "fill in" any unnamed template parameters from the original
declaration, so that pretty printing isn't so ugly.

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

* [Bug c++/57014] pretty-printer prints anonymous for template-parameter with a name
       [not found] <bug-57014-4@http.gcc.gnu.org/bugzilla/>
  2021-08-10 11:02 ` [Bug c++/57014] pretty-printer prints anonymous for template-parameter with a name redi at gcc dot gnu.org
@ 2021-08-12 12:07 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 2+ messages in thread
From: redi at gcc dot gnu.org @ 2021-08-12 12:07 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #0)
> /home/manuel/test3/src/gcc/testsuite/g++.dg/other/default5.C:47:22: error:
> default argument missing for parameter 2 of ‘void B<<anonymous> >::F2(int,
> int, int)’
>  template<int N> void B<N>::F2(int = 0, int, int) {}  // { dg-error
> "default" }
>                       ^
> 
> It should say 'void B<N>::F2(int,int,int)

That is PR 20313

> The location is wrong, it should point to parameter 2.

That part is fixed (see comment 2).

*** This bug has been marked as a duplicate of bug 20313 ***

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

end of thread, other threads:[~2021-08-12 12:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-57014-4@http.gcc.gnu.org/bugzilla/>
2021-08-10 11:02 ` [Bug c++/57014] pretty-printer prints anonymous for template-parameter with a name redi at gcc dot gnu.org
2021-08-12 12:07 ` redi 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).