[PATCH] Fix crash in typo correction while correcting enum within a struct in C

Kaelyn Takata rikka at google.com
Thu Jan 8 18:13:23 PST 2015


Other than the 80 column violation around line 5994 where the
cast<CXXRecordDecl> was changed to a dyn_cast (using clang-format is the
easiest way to fix the formatting), the patch LGTM.

On Thu, Jan 8, 2015 at 1:12 PM, Olivier Goffart <ogoffart at kde.org> wrote:

> Hi,
>
> Please review the attached patch.
> It fix a crash while trying to compile the code that is in the testcase
> (in C
> mode). This crash is a regression since 3.5
>
> The problem is that "isCXXClassMember" for the NameDecl of the enum values
> returns true even tough we are in C mode. Therefore, the DeclContext is
> not a
> CXXRecordDecl, but just a plain RecordDecl.
> I'm taking the least intrusive approach by handling the case in which the
> cast
> would otherwise fail.
>
> Thanks
> --
> Olivier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150108/0d6b2501/attachment.html>


More information about the cfe-commits mailing list