public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94588] New: Improve redeclared parameter name diagnostic
@ 2020-04-13 22:56 mpolacek at gcc dot gnu.org
  2020-04-13 22:57 ` [Bug c++/94588] " mpolacek at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-13 22:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94588
           Summary: Improve redeclared parameter name diagnostic
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

void
f (int i)
{
  int i;
}

is correctly rejected ([basic.scope.param]) but we don't print the previous
decl:

$ g++ -c p.C
p.C: In function ‘void f(int)’:
p.C:4:7: error: declaration of ‘int i’ shadows a parameter
    4 |   int i;
      |       ^

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

* [Bug c++/94588] Improve redeclared parameter name diagnostic
  2020-04-13 22:56 [Bug c++/94588] New: Improve redeclared parameter name diagnostic mpolacek at gcc dot gnu.org
@ 2020-04-13 22:57 ` mpolacek at gcc dot gnu.org
  2020-04-13 23:01 ` mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-13 22:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2020-04-13
           Keywords|                            |diagnostic
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org

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

* [Bug c++/94588] Improve redeclared parameter name diagnostic
  2020-04-13 22:56 [Bug c++/94588] New: Improve redeclared parameter name diagnostic mpolacek at gcc dot gnu.org
  2020-04-13 22:57 ` [Bug c++/94588] " mpolacek at gcc dot gnu.org
@ 2020-04-13 23:01 ` mpolacek at gcc dot gnu.org
  2020-04-14  3:12 ` cvs-commit at gcc dot gnu.org
  2020-04-14  3:13 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-13 23:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
...nor in the outermost block of any handler associated with a
function-try-block:

void
g (int i)
  try
    {
    }
  catch (...)
    {
      int i;
    }

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

* [Bug c++/94588] Improve redeclared parameter name diagnostic
  2020-04-13 22:56 [Bug c++/94588] New: Improve redeclared parameter name diagnostic mpolacek at gcc dot gnu.org
  2020-04-13 22:57 ` [Bug c++/94588] " mpolacek at gcc dot gnu.org
  2020-04-13 23:01 ` mpolacek at gcc dot gnu.org
@ 2020-04-14  3:12 ` cvs-commit at gcc dot gnu.org
  2020-04-14  3:13 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-14  3:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:7eee265e6bd58bf48da70fef97f2ac7179a9f41c

commit r10-7709-g7eee265e6bd58bf48da70fef97f2ac7179a9f41c
Author: Marek Polacek <polacek@redhat.com>
Date:   Mon Apr 13 19:06:39 2020 -0400

    c++: Improve redeclared parameter name diagnostic [PR94588]

    While reviewing [basic.scope.param] I noticed we don't show the location
    of the previous declaration when giving an error about "A parameter name
    shall not be redeclared in the outermost block of the function definition".

            PR c++/94588
            * name-lookup.c (check_local_shadow): Add an inform call.

            * g++.dg/diagnostic/redeclaration-1.C: Add dg-message.

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

* [Bug c++/94588] Improve redeclared parameter name diagnostic
  2020-04-13 22:56 [Bug c++/94588] New: Improve redeclared parameter name diagnostic mpolacek at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-04-14  3:12 ` cvs-commit at gcc dot gnu.org
@ 2020-04-14  3:13 ` mpolacek at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-04-14  3:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2020-04-14  3:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-13 22:56 [Bug c++/94588] New: Improve redeclared parameter name diagnostic mpolacek at gcc dot gnu.org
2020-04-13 22:57 ` [Bug c++/94588] " mpolacek at gcc dot gnu.org
2020-04-13 23:01 ` mpolacek at gcc dot gnu.org
2020-04-14  3:12 ` cvs-commit at gcc dot gnu.org
2020-04-14  3:13 ` 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).