[cfe-dev] RFC: unreachable catch-clauses due to superclass cathes

Erik Verbruggen erikjv at me.com
Thu Jul 30 03:34:31 PDT 2009

Hi all,

After doing duplicate handlers for exceptions in C++, there is still a FIXME in Sema::ActOnCXXTryBlock which I am thinking of fixing:

  // FIXME: We should detect handlers that cannot catch anything because an
  // earlier handler catches a superclass. Need to find a method that is not
  // quadratic for this.

I pondered a bit on this, and I cannot think of a non-quadratic algorithm. So, does anybody have ideas for this?

I am currently thinking of implementing a quadratic algorithm for it, and keep a TODO mentioning that the algorithm should be improved. That way, there at least is a check, albeit maybe not the most efficient one.

-- Erik.

More information about the cfe-dev mailing list