public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15745] exception specification incorrectly changes the type of the exception thrown
       [not found] <bug-15745-8173@http.gcc.gnu.org/bugzilla/>
@ 2007-09-06  3:34 ` jason at gcc dot gnu dot org
  2007-10-01 20:53 ` jason at gcc dot gnu dot org
  2008-11-18 18:52 ` jason at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-09-06  3:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jason at gcc dot gnu dot org  2007-09-06 03:33 -------
Subject: Bug 15745

Author: jason
Date: Thu Sep  6 03:33:46 2007
New Revision: 128174

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128174
Log:
        PR c++/15745
        * except.c (prepare_eh_type): Use type_decays_to.

Added:
    trunk/gcc/testsuite/g++.dg/eh/spec9.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/except.c
    trunk/gcc/testsuite/g++.dg/ext/vla4.C


-- 


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


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

* [Bug c++/15745] exception specification incorrectly changes the type of the exception thrown
       [not found] <bug-15745-8173@http.gcc.gnu.org/bugzilla/>
  2007-09-06  3:34 ` [Bug c++/15745] exception specification incorrectly changes the type of the exception thrown jason at gcc dot gnu dot org
@ 2007-10-01 20:53 ` jason at gcc dot gnu dot org
  2008-11-18 18:52 ` jason at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu dot org @ 2007-10-01 20:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jason at gcc dot gnu dot org  2007-10-01 20:53 -------
Subject: Bug 15745

Author: jason
Date: Mon Oct  1 20:53:09 2007
New Revision: 128917

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128917
Log:
        PR c++/15745
        * except.c (prepare_eh_type): Use type_decays_to.

Modified:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/ext/vla4.C


-- 


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


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

* [Bug c++/15745] exception specification incorrectly changes the type of the exception thrown
       [not found] <bug-15745-8173@http.gcc.gnu.org/bugzilla/>
  2007-09-06  3:34 ` [Bug c++/15745] exception specification incorrectly changes the type of the exception thrown jason at gcc dot gnu dot org
  2007-10-01 20:53 ` jason at gcc dot gnu dot org
@ 2008-11-18 18:52 ` jason at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-11-18 18:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jason at gcc dot gnu dot org  2008-11-18 18:50 -------
Fixed.


-- 

jason at gcc dot gnu dot org changed:

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


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


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

* [Bug c++/15745] exception specification incorrectly changes the type of the exception thrown
  2004-05-31 22:08 [Bug c++/15745] New: " wsf at fultondesigns dot co dot uk
  2004-05-31 22:26 ` [Bug c++/15745] " pinskia at gcc dot gnu dot org
  2004-06-01 15:28 ` bangerth at dealii dot org
@ 2004-06-26 20:22 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-06-26 20:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-06-26 20:22 -------
Confirmed.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-26 20:22:14
               date|                            |


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


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

* [Bug c++/15745] exception specification incorrectly changes the type of the exception thrown
  2004-05-31 22:08 [Bug c++/15745] New: " wsf at fultondesigns dot co dot uk
  2004-05-31 22:26 ` [Bug c++/15745] " pinskia at gcc dot gnu dot org
@ 2004-06-01 15:28 ` bangerth at dealii dot org
  2004-06-26 20:22 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: bangerth at dealii dot org @ 2004-06-01 15:28 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-06-01 15:27 -------
Confirmed. Here's a small testcase: 
------------------- 
typedef int IntArray[10]; 
IntArray i; 
 
void test_array() 
#ifdef TEST 
  throw (IntArray) 
#endif 
{ throw i; } 
 
 
int main () { 
    try { 
        test_array(); 
    } catch (IntArray) {} 
} 
------------------ 
 
We get 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ x.cc ; ./a.out  
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ x.cc -DTEST ; ./a.out  
terminate called after throwing an instance of 'int*' 
Aborted 
 
The point is that if we throw an exception that violates the exception 
specification, then it is converted into an unspec exception and we 
abort. However, since we can catch the exception that we throw in the  
main function if there is no exception specification on the function 
body, it seems as if the exception thrown is really of type IntArray 
and shouldn't violate the exception specification. I agree that this 
is confusing and looks like a bug in gcc associated with decaying 
arrays to pointers, though I'd like to solicit a second opinion on 
this. 
 
We get the same results for all gcc versions from 2.95 to mainline. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
      Known to fail|                            |2.95.3 3.3.1 3.0.4 3.4.0
                   |                            |3.5.0


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


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

* [Bug c++/15745] exception specification incorrectly changes the type of the exception thrown
  2004-05-31 22:08 [Bug c++/15745] New: " wsf at fultondesigns dot co dot uk
@ 2004-05-31 22:26 ` pinskia at gcc dot gnu dot org
  2004-06-01 15:28 ` bangerth at dealii dot org
  2004-06-26 20:22 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-05-31 22:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-05-31 13:15 -------
If I recall correctly from my reading of the standard arrays get decayed to pointers for things like this 
(and a couple of others too).

-- 


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


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

end of thread, other threads:[~2008-11-18 18:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-15745-8173@http.gcc.gnu.org/bugzilla/>
2007-09-06  3:34 ` [Bug c++/15745] exception specification incorrectly changes the type of the exception thrown jason at gcc dot gnu dot org
2007-10-01 20:53 ` jason at gcc dot gnu dot org
2008-11-18 18:52 ` jason at gcc dot gnu dot org
2004-05-31 22:08 [Bug c++/15745] New: " wsf at fultondesigns dot co dot uk
2004-05-31 22:26 ` [Bug c++/15745] " pinskia at gcc dot gnu dot org
2004-06-01 15:28 ` bangerth at dealii dot org
2004-06-26 20:22 ` pinskia at gcc dot gnu dot 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).