[cfe-dev] Clang libtool crashing with error "Assertion `Name.isIdentifier() && "Name is not a simple identifier"' failed"

Reid Kleckner via cfe-dev cfe-dev at lists.llvm.org
Wed Oct 12 08:34:53 PDT 2016


There are many kinds of DeclarationName in Clang:
  enum NameKind {
    Identifier,
    ObjCZeroArgSelector,
    ObjCOneArgSelector,
    ObjCMultiArgSelector,
    CXXConstructorName,
    CXXDestructorName,
    CXXConversionFunctionName,
    CXXOperatorName,
    CXXLiteralOperatorName,
    CXXUsingDirective
  };

getName only works on simple identifiers. You can use getNameAsString
or printName if you want clang to synthesize a string for a non-identifier
name.

On Wed, Oct 12, 2016 at 2:55 AM, Abhishek Kumar via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hello
> I am trying to build a static-analyzer for C/C++ programs using clang 3.9
> libtool. My code crashes for some C++ programs, with the assertion error
> """ Assertion `Name.isIdentifier() && "Name is not a simple identifier"'
> failed """.
>     It is caused by clang::FunctionDecl::getName function call which I am
> calling to get the name of the function declaration.
>
> Can someone please help with possible reasons and potential fixes of this
> error? As far as I know this was some bug till 3.8 but has been fixed now.
> I have built clang 3.9 from sources.
>
> Thanks
> Abhishek Kumar
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161012/e14f5a52/attachment.html>


More information about the cfe-dev mailing list