[PATCH] NoReturn Warning: Removed Warning for Unreachable Return

Aaron Ballman aaron at aaronballman.com
Wed Jan 8 15:10:39 PST 2014


On Sun, Jan 5, 2014 at 5:34 PM, Michael Bao <mike.h.bao at gmail.com> wrote:
> On Sat, Jan 4, 2014 at 1:39 PM, Aaron Ballman <aaron at aaronballman.com> wrote:
>>
>> That makes sense as to why you'd move it, but I'm still concerned
>> about this changing the semantics. For instance, this can now fire for
>> ObjCMethodDecl objects, where it used to not be possible. This could
>> be a bug fix, but it would also require further testing (and
>> confirmation from some of the ObjC experts as to whether this is
>> desirable).
>
> Hm, wouldn't the wrap around the diagnostic call with
>
> if (const FunctionDecl *FD = getCurFunctionDecl()) {
> }
>
> prevent it from firing for ObjCMethodDecl objects?

Ah, yes, that would, sorry for the needless worry. Having had the
chance to look at it in context with greater detail, I retract my
concerns about the position of the code.

~Aaron



More information about the cfe-commits mailing list