public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31952] parameters may be redeclared in a function try-block
       [not found] <bug-31952-4@http.gcc.gnu.org/bugzilla/>
@ 2012-08-20 10:30 ` paolo.carlini at oracle dot com
  2012-08-20 10:43 ` paolo.carlini at oracle dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-08-20 10:30 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

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

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-20 10:29:11 UTC ---
Comment #2 is PR5605.

Comparing to Janis' fix for PR2288
(http://gcc.gnu.org/ml/gcc-patches/2010-03/msg00838.html) looks like the
pushdecl_maybe_friend_1 checks must be beefed up, maybe we need an additional
sk_* for Comment #2. Seems doable.

Adding Janis in CC in case she wants to beat me (or somebody else) on this.


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

* [Bug c++/31952] parameters may be redeclared in a function try-block
       [not found] <bug-31952-4@http.gcc.gnu.org/bugzilla/>
  2012-08-20 10:30 ` [Bug c++/31952] parameters may be redeclared in a function try-block paolo.carlini at oracle dot com
@ 2012-08-20 10:43 ` paolo.carlini at oracle dot com
  2013-05-13 19:29 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2012-08-20 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cs at plesk dot com

--- Comment #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-20 10:40:59 UTC ---
*** Bug 5605 has been marked as a duplicate of this bug. ***


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

* [Bug c++/31952] parameters may be redeclared in a function try-block
       [not found] <bug-31952-4@http.gcc.gnu.org/bugzilla/>
  2012-08-20 10:30 ` [Bug c++/31952] parameters may be redeclared in a function try-block paolo.carlini at oracle dot com
  2012-08-20 10:43 ` paolo.carlini at oracle dot com
@ 2013-05-13 19:29 ` paolo.carlini at oracle dot com
  2013-05-14 15:55 ` jason at gcc dot gnu.org
  2013-05-15 16:11 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-05-13 19:29 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

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

--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Jason, I'm on this issue but I'm not sure how we want to resolve it.

After Janis' patch (see Comment #6) in pushdecl_maybe_friend_1 we issue hard
errors for some kinds of shadowings but not for others. For comparison, clang
issues hard errors for all three testcases here, ICC warnings (like current
GCC). If we wanted, I could tweak the parser to carefully do_pushlevel
(sk_catch) and therefore change to errors only the specific shadowings at issue
in this PR, but I'm also aiming for some consistency.


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

* [Bug c++/31952] parameters may be redeclared in a function try-block
       [not found] <bug-31952-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-05-13 19:29 ` paolo.carlini at oracle dot com
@ 2013-05-14 15:55 ` jason at gcc dot gnu.org
  2013-05-15 16:11 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 10+ messages in thread
From: jason at gcc dot gnu.org @ 2013-05-14 15:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Paolo Carlini from comment #9)
> After Janis' patch (see Comment #6) in pushdecl_maybe_friend_1 we issue hard
> errors for some kinds of shadowings but not for others. For comparison,
> clang issues hard errors for all three testcases here, ICC warnings (like
> current GCC). If we wanted, I could tweak the parser to carefully
> do_pushlevel (sk_catch) and therefore change to errors only the specific
> shadowings at issue in this PR, but I'm also aiming for some consistency.

Well, the language requires diagnostics for some shadowings and not others, so
it makes sense for us to mirror that.  But we probably want permerror rather
than error.


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

* [Bug c++/31952] parameters may be redeclared in a function try-block
       [not found] <bug-31952-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2013-05-14 15:55 ` jason at gcc dot gnu.org
@ 2013-05-15 16:11 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2013-05-15 16:11 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
                 CC|jason at gcc dot gnu.org           |
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.0

--- Comment #11 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.9.0.


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

* [Bug c++/31952] parameters may be redeclared in a function try-block
  2007-05-16 13:13 [Bug c++/31952] New: " andrew dot stubbs at st dot com
                   ` (3 preceding siblings ...)
  2007-11-01 18:15 ` andrew dot stubbs at st dot com
@ 2009-11-06  6:58 ` pi3orama at gmail dot com
  4 siblings, 0 replies; 10+ messages in thread
From: pi3orama at gmail dot com @ 2009-11-06  6:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pi3orama at gmail dot com  2009-11-06 06:58 -------
still not solved at 4.3.4


-- 


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


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

* [Bug c++/31952] parameters may be redeclared in a function try-block
  2007-05-16 13:13 [Bug c++/31952] New: " andrew dot stubbs at st dot com
                   ` (2 preceding siblings ...)
  2007-05-17 14:52 ` bangerth at dealii dot org
@ 2007-11-01 18:15 ` andrew dot stubbs at st dot com
  2009-11-06  6:58 ` pi3orama at gmail dot com
  4 siblings, 0 replies; 10+ messages in thread
From: andrew dot stubbs at st dot com @ 2007-11-01 18:15 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from andrew dot stubbs at st dot com  2007-11-01 18:15 -------
It gets worse :(

The following example used to be detected by GCC 4.1.1, but is now permitted by
GCC 4.1.2, 4.2.1, 4.2.2, and 4.3-20071026, and hence is a regression.

int
foo (int bar)
try
{
  return 0;
}
catch (int bar)  // invalid
{
  return 1;
}


-Wshadow still detects it, but it is no longer an error.


-- 


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


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

* [Bug c++/31952] parameters may be redeclared in a function try-block
  2007-05-16 13:13 [Bug c++/31952] New: " andrew dot stubbs at st dot com
  2007-05-16 19:47 ` [Bug c++/31952] " fang at csl dot cornell dot edu
  2007-05-17 14:35 ` andrew dot stubbs at st dot com
@ 2007-05-17 14:52 ` bangerth at dealii dot org
  2007-11-01 18:15 ` andrew dot stubbs at st dot com
  2009-11-06  6:58 ` pi3orama at gmail dot com
  4 siblings, 0 replies; 10+ messages in thread
From: bangerth at dealii dot org @ 2007-05-17 14:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from bangerth at dealii dot org  2007-05-17 15:51 -------
Confirmed.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |accepts-invalid, diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2007-05-17 15:51:41
               date|                            |


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


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

* [Bug c++/31952] parameters may be redeclared in a function try-block
  2007-05-16 13:13 [Bug c++/31952] New: " andrew dot stubbs at st dot com
  2007-05-16 19:47 ` [Bug c++/31952] " fang at csl dot cornell dot edu
@ 2007-05-17 14:35 ` andrew dot stubbs at st dot com
  2007-05-17 14:52 ` bangerth at dealii dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: andrew dot stubbs at st dot com @ 2007-05-17 14:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from andrew dot stubbs at st dot com  2007-05-17 15:34 -------
Another example perhaps?

void
foo()
{
  try
    {
    }
  catch (void *e)
    {
      void *e; // invalid
    }
}

The C++ standard, clause 3.3.2 paragraph 3, states that catch
exception-declarations may not be redeclared in the outermost block of the
catch block.


-- 


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


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

* [Bug c++/31952] parameters may be redeclared in a function try-block
  2007-05-16 13:13 [Bug c++/31952] New: " andrew dot stubbs at st dot com
@ 2007-05-16 19:47 ` fang at csl dot cornell dot edu
  2007-05-17 14:35 ` andrew dot stubbs at st dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: fang at csl dot cornell dot edu @ 2007-05-16 19:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fang at csl dot cornell dot edu  2007-05-16 20:46 -------
Poor man's workaround: -Wshadow -Werror


-- 

fang at csl dot cornell dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fang at csl dot cornell dot
                   |                            |edu


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


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

end of thread, other threads:[~2013-05-15 16:11 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-31952-4@http.gcc.gnu.org/bugzilla/>
2012-08-20 10:30 ` [Bug c++/31952] parameters may be redeclared in a function try-block paolo.carlini at oracle dot com
2012-08-20 10:43 ` paolo.carlini at oracle dot com
2013-05-13 19:29 ` paolo.carlini at oracle dot com
2013-05-14 15:55 ` jason at gcc dot gnu.org
2013-05-15 16:11 ` paolo.carlini at oracle dot com
2007-05-16 13:13 [Bug c++/31952] New: " andrew dot stubbs at st dot com
2007-05-16 19:47 ` [Bug c++/31952] " fang at csl dot cornell dot edu
2007-05-17 14:35 ` andrew dot stubbs at st dot com
2007-05-17 14:52 ` bangerth at dealii dot org
2007-11-01 18:15 ` andrew dot stubbs at st dot com
2009-11-06  6:58 ` pi3orama at gmail dot com

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