[cfe-dev] Null CharacterLiteral Error

dblaikie at gmail.com dblaikie at gmail.com
Wed Jan 8 11:51:41 PST 2014

Works for Clang, so there must be something else going on in your program:

blaikie at blaikie:~/dev/scratch$ clang++-tot -Xclang -ast-dump ast.cpp -w

TranslationUnitDecl 0x5ec3190 <<invalid sloc>>

|-TypedefDecl 0x5ec36d0 <<invalid sloc>> __int128_t '__int128'

|-TypedefDecl 0x5ec3730 <<invalid sloc>> __uint128_t 'unsigned __int128'

|-TypedefDecl 0x5ec3af0 <<invalid sloc>> __builtin_va_list '__va_list_tag

`-VarDecl 0x5ec3b80 <ast.cpp:1:1, col:13> ptr 'char *'

  `-ImplicitCastExpr 0x5f0b030 <col:13> 'char *' <NullToPointer>

    `-CharacterLiteral 0x5ec3bd8 <col:13> 'char' 0

1 warning generated.

On Wed Jan 08 2014 at 3:07:34 AM, Vladimir <VladimirPlyashkun at yandex.ru>

> Hello, everyone. I have a strange problem. In my small app(i just traverse
> an
> AST), clang cannot parse expression:
> char* ptr = '\0';
> This nodes just dont appear in AST. Why clang ignored this statement or why
> it cant parse it? Character literal should just implicit cast to integral
> literal and then to null pointer.
> I've tried also test:
> char ch = '\0';
> this works good;
> I suggest, that the problem in DefinitionKinds.def or maybe similar, but i
> dont know what to do.
> --
> View this message in context: http://clang-developers.42468.
> n3.nabble.com/Null-CharacterLiteral-Error-tp4036979.html
> Sent from the Clang Developers mailing list archive at Nabble.com.
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140108/99227b7d/attachment.html>

More information about the cfe-dev mailing list