[cfe-dev] Fix to the exception specifications type checking

Douglas Gregor dgregor at apple.com
Wed Dec 9 17:28:09 PST 2009


On Dec 8, 2009, at 3:05 PM, Nicola Gigante wrote:

> 
> Il giorno 08/dic/2009, alle ore 23.37, Sean Hunt ha scritto:
> 
>> 
>> Looking at CWG Issue #437, it should be. It would probably be a good
>> idea to add a testcase to make sure that works.
>> 
> 
> Ok. Here is the same patch with a new testcase. I hope it's useful.

A couple comments:

+  // This check deals with core issue 437, when we have a member function of a
+  // class that throws the class itself.

It's nice to quote the actual standard text, so we don't have to refer to some other document when reading through this code, like below:

   // C++ 15.4p2: A type denoted in an exception-specification shall not denote
   //   an incomplete type.

+  if (T->isRecordType() && T->getAs<RecordType>()->isBeingDefined())
+	  return false;

Please uses spaces only (no tabs). 

There's another call to RequireCompleteType later in the function; you'll need to do a similar check there for pointers  or references to classes that are being defined.

	- Doug



More information about the cfe-dev mailing list