<div dir="ltr"><div style>I am new to clang ast, and trying to parse some c++ code with it.</div><div style><br></div>When I am using TypedefDecl->getSourceRange() for say<div style>typedef long double LDBL it returns the whole thing </div>
<div style>However when I am using TypeAliasDecl->getSourceRange() for say</div><div style>using LDBL = long double</div><div style>it only returns the range using LDBL = long. (i.e removes the double part)</div><div style>
<br></div><div style>I used the code below to extract text from SourceRange</div><div style><div>char const* first = sm.getCharacterData(r.getBegin()); </div><div> char const* last = sm.getCharacterData(pp.getLocForEndOfToken(r.getEnd()));</div>
<div> return std::string(first,last);</div><div><br></div><div style>Am I doing something wrong? How can I get the whole source range, and esp the type part of it i.e. long double part, so that I can rearrange it as typedef long double LDBL</div>
</div><div style>I am using clang 3.2 with RAV</div><div style><br></div><div style>Any help will be appreciated.</div><div style>Thanks</div></div>