Works for Clang, so there must be something else going on in your program:<br><br>
<p class="p1">blaikie@blaikie:~/dev/scratch$ clang++-tot -Xclang -ast-dump ast.cpp -w</p>
<p class="p4"><span class="s2">TranslationUnitDecl</span> 0x5ec3190<span class="s3"> <</span><invalid sloc><span class="s3">></span></p>
<p class="p4"><span class="s4">|-</span><span class="s2">TypedefDecl</span> 0x5ec36d0<span class="s3"> <</span><invalid sloc><span class="s3">></span><span class="s5"> __int128_t</span><span class="s3"> </span><span class="s2">'__int128'</span></p>
<p class="p3"><span class="s4">|-</span>TypedefDecl<span class="s6"> 0x5ec3730</span><span class="s3"> <</span><span class="s6"><invalid sloc></span><span class="s3">></span><span class="s5"> __uint128_t</span><span class="s3"> </span>'unsigned __int128'</p>
<p class="p3"><span class="s4">|-</span>TypedefDecl<span class="s6"> 0x5ec3af0</span><span class="s3"> <</span><span class="s6"><invalid sloc></span><span class="s3">></span><span class="s5"> __builtin_va_list</span><span class="s3"> </span>'__va_list_tag [1]'</p>
<p class="p4"><span class="s4">`-</span><span class="s2">VarDecl</span> 0x5ec3b80<span class="s3"> <</span>ast.cpp:1:1<span class="s3">, </span>col:13<span class="s3">></span><span class="s5"> ptr</span><span class="s3"> </span><span class="s2">'char *'</span></p>
<p class="p5"><span class="s4">š `-</span>ImplicitCastExpr<span class="s6"> 0x5f0b030</span><span class="s3"> <</span><span class="s6">col:13</span><span class="s3">> </span><span class="s2">'char *'</span><span class="s3"> <</span><span class="s7">NullToPointer</span><span class="s3">></span></p>
<p class="p5"><span class="s4">š š `-</span>CharacterLiteral<span class="s6"> 0x5ec3bd8</span><span class="s3"> <</span><span class="s6">col:13</span><span class="s3">> </span><span class="s2">'char'</span><span class="s5"> 0</span></p>
<p class="p1">1 warning generated.</p><br><div>On Wed Jan 08 2014 at 3:07:34 AM, Vladimir <<a href="mailto:VladimirPlyashkun@yandex.ru">VladimirPlyashkun@yandex.ru</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello, everyone. I have a strange problem. In my small app(i just traverse an<br>
AST), clang cannot parse expression:<br>
char* ptr = '\0';<br>
This nodes just dont appear in AST. Why clang ignored this statement or why<br>
it cant parse it? Character literal should just implicit cast to integral<br>
literal and then to null pointer.<br>
I've tried also test:<br>
char ch = '\0';<br>
this works good;<br>
I suggest, that the problem in DefinitionKinds.def or maybe similar, but i<br>
dont know what to do.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Null-CharacterLiteral-Error-tp4036979.html" target="_blank">http://clang-developers.42468.<u></u>n3.nabble.com/Null-<u></u>CharacterLiteral-Error-<u></u>tp4036979.html</a><br>
Sent from the Clang Developers mailing list archive at Nabble.com.<br>
______________________________<u></u>_________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu" target="_blank">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/cfe-dev</a><br>
</blockquote>