<div dir="ltr"><div>I noticed that the tokens returned from a cursor pointing to a macro change if there is a typedef following a macro.</div><div><br></div><div>How do I go about submiting a bug against this?</div><div><br>

</div><div>import clang.cindex as cindex</div><div>from clang.util import get_cursor,get_cursors</div><div><br></div><div>t = cindex.TranslationUnit</div><div>options=t.PARSE_DETAILED_PROCESSING_RECORD | t.PARSE_PRECOMPILED_PREAMBLE</div>

<div><br></div><div><br></div><div>src1 ="""</div><div>#define TEST 5</div><div>"""</div><div>tu = t.from_source('t.c',"",unsaved_files=[('t.c',src1)],options=options)</div>

<div>cursor = get_cursor(tu.cursor,'TEST')</div><div>tokens = list(cursor.get_tokens())</div><div>print tokens[-1].spelling #Prints 5 OK</div><div><br></div><div>src2 = """</div><div>#define TEST 5</div>

<div>typedef int int8;</div><div>"""</div><div>tu = t.from_source('t.c',"",unsaved_files=[('t.c',src2)],options=options)</div><div>cursor = get_cursor(tu.cursor,'TEST')</div>

<div>tokens = list(cursor.get_tokens())</div><div>print tokens[-1].spelling #Prints typedef FAIL</div><div><br></div><div><br></div>-- <br>Thank you,<br><br>Sam Price<br></div>