This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Support "nothrow" function attribute


On Sun, May 26, 2002 at 07:21:52PM -0600, Roger Sayle wrote:
> 	* c-common.c: Add support for __attribute__((nothrow)) to specify
> 	that a function cannot throw an exception (using TREE_NOTHROW).
> 	(handle_nothrow_attribute): New function to process this attribute.
> 
> 	* doc/extend.texi: Document the new nothrow function attribute.

This is ok.

> + extern void foo (void) __attribute__ ((section ("cross")));
> + extern void superman (void) __attribute__ ((alias ("clark_kent")));

Can't test these generically.

What's the point of this test case, anyway?  Seems to me that
we should be doing functionality tests for each of these
attributes, which tests parsing at the same time.

For instance, this patch should be accompanied by a C++ test like

	// { dg-do link }
	extern void foo() __attribute__((nothrow))
	extern void link_error();
	int main()
	{
	  try {
	    foo();
	  } catch (...) {
	    link_error();
	  }
	}
	void foo() { }

which should fail before your patch and pass afterward.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]