[PATCH] AST matcher for catch(...)

Aaron Ballman aaron at aaronballman.com
Thu Jul 2 05:53:52 PDT 2015


On Thu, Jul 2, 2015 at 12:47 AM, Manuel Klimek <klimek at google.com> wrote:
> Looks good. Thanks!

Thanks! Commit in r241256

~Aaron

>
> On Wed, Jul 1, 2015 at 11:16 PM Aaron Ballman <aaron at aaronballman.com>
> wrote:
>>
>> I was making a brief foray into AST matchers over exception handling
>> code today, and I noticed there's no way (that I could find) to match
>> only catch-all exception handlers. Eg)
>>
>> try {
>> } catch (int) {
>> } catch (...) { // Only want to match this
>> }
>>
>> The attached patch adds the matcher, test case, and documentation for
>> such a thing. I am not strongly tied to "catch all" as the name, but
>> alternatives like "handlesAnyType" sound like it would match
>> catch(int) as well as catch(...). If there's a better name, I'd be
>> happy to make use of it.
>>
>> Thanks!
>>
>> ~Aaron



More information about the cfe-commits mailing list