[Bug c++/31952] parameters may be redeclared in a function try-block

2013-05-15 Thread paolo.carlini at oracle dot com
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.


[Bug c++/31952] parameters may be redeclared in a function try-block

2013-05-14 Thread jason at gcc dot gnu.org
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.


[Bug c++/31952] parameters may be redeclared in a function try-block

2013-05-13 Thread paolo.carlini at oracle dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31952

Paolo Carlini paolo.carlini at oracle dot com changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |paolo.carlini at oracle 
dot com

--- Comment #8 from Paolo Carlini paolo.carlini at oracle dot com ---
On it.


[Bug c++/31952] parameters may be redeclared in a function try-block

2013-05-13 Thread paolo.carlini at oracle dot com
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.


[Bug c++/31952] parameters may be redeclared in a function try-block

2012-08-20 Thread paolo.carlini at oracle dot com
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.


[Bug c++/31952] parameters may be redeclared in a function try-block

2012-08-20 Thread paolo.carlini at oracle dot com
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. ***


[Bug c++/31952] parameters may be redeclared in a function try-block

2009-11-05 Thread pi3orama at gmail dot com


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



[Bug c++/31952] parameters may be redeclared in a function try-block

2007-11-01 Thread andrew dot stubbs at st dot com


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



[Bug c++/31952] parameters may be redeclared in a function try-block

2007-05-17 Thread andrew dot stubbs at st dot com


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



[Bug c++/31952] parameters may be redeclared in a function try-block

2007-05-17 Thread bangerth at dealii dot org


--- 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|-00-00 00:00:00 |2007-05-17 15:51:41
   date||


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



[Bug c++/31952] parameters may be redeclared in a function try-block

2007-05-16 Thread fang at csl dot cornell dot edu


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