[cfe-dev] Null CharacterLiteral Error

Richard Smith metafoo at gmail.com
Wed Jan 8 12:58:41 PST 2014

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.

Is it possible you're building in C++11 mode? This code is ill-formed in
C++11, where a null pointer constant must be written as either an integer
zero or as nullptr.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140108/f5d7641c/attachment.html>

More information about the cfe-dev mailing list