This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Support "nothrow" function attribute
- From: Roger Sayle <roger at eyesopen dot com>
- To: Richard Henderson <rth at redhat dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 27 May 2002 15:04:57 -0600 (MDT)
- Subject: Re: [PATCH] Support "nothrow" function attribute
> > Ahhh! That's how to do it. Can I have permission to add this test
> > (with suitable comments) to the testsuite as g++.dg/ext/attrib6.C?
>
> Assuming it actually works, yes. ;-)
I've now tested this with my patch applied to mainline CVS, and it does
indeed work. Here's the actual diff for the new test case that I've
committed along with my "nothrow" attribute changes. Thanks again.
2002-05-27 Richard Henderson <rth@redhat.com>
* g++.dg/ext/attrib6.C: New test case.
*** /dev/null Thu Aug 30 14:30:55 2001
--- g++.dg/ext/attrib6.C Mon May 27 15:06:14 2002
***************
*** 0 ****
--- 1,21 ----
+ // Copyright (C) 2002 Free Software Foundation.
+ //
+ // Test that the nothrow attribute is working correctly.
+ //
+ // Written by Richard Henderson, 26 May 2002.
+
+ // { dg-do link }
+ extern void foo() __attribute__((nothrow));
+ extern void link_error();
+
+ int main()
+ {
+ try {
+ foo();
+ } catch (...) {
+ link_error();
+ }
+ }
+
+ void foo() { }
+
Roger
--
Roger Sayle, E-mail: roger@eyesopen.com
OpenEye Scientific Software, WWW: http://www.eyesopen.com/
Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385
Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833