<div>Greetings! I'm using clang for source-to-source translation.</div><div> </div><div>Recently I got a problem with parsing code which use templates.</div><div>First, here is the working example:</div><div> </div><div><div><span style="font-family:'courier new' , monospace">struct MyTestVector2</span></div><div><span style="font-family:'courier new' , monospace">{<!-- --></span></div><div><span style="font-family:'courier new' , monospace"> unsigned int _data[6];</span></div><div><span style="font-family:'courier new' , monospace"> unsigned int * data() { return &_data[0]; }</span></div><div><span style="font-family:'courier new' , monospace">};</span></div></div><div><span style="font-family:'courier new' , monospace">... </span></div><div><div><span style="font-family:'courier new' , monospace">MyTestVector2 testData2;</span></div><div><span style="font-family:'courier new' , monospace">kernel_TestColor(&hit, </span></div><div><span style="font-family:'courier new' , monospace">                testData2.data(), tidX, tidY);</span></div></div><div>This code processed normally and i gon correct "CXXMemberCallExpr" node for kernel_TestColor which i actually need.</div><div>Then i changed MyTestVector2 to template:</div><div> </div><div><div><span style="font-family:'courier new' , monospace">template<class T></span></div><div><span style="font-family:'courier new' , monospace">struct MyTestVector2</span></div><div><span style="font-family:'courier new' , monospace">{<!-- --></span></div><div><span style="font-family:'courier new' , monospace"> T _data[6];</span></div><div><span style="font-family:'courier new' , monospace"> T * data() { return &_data[0]; }</span></div><div><span style="font-family:'courier new' , monospace">};</span></div><div> </div><div><span style="font-family:'courier new' , monospace">...</span></div><div><span style="font-family:'courier new' , monospace">MyTestVector2<unsigned int> testData2;</span></div><div><span style="font-family:'courier new' , monospace">kernel_TestColor(&hit,</span></div><div><span style="font-family:'courier new' , monospace">                testData2.data(), tidX, tidY);</span></div><div> </div></div><div>This time i got</div><div> </div><div><div>`-DeclStmt 0x55555816e128 <line:59:3, col:40></div><div>  `-VarDecl 0x55555816e0c0 <col:3, col:31> col:31 invalid testData2 'MyTestVector2<unsigned int>':'MyTestVector2<unsigned int>'</div></div><div> </div><div>This time, The AST node for <span style="font-family:'courier new' , monospace">kernel_TestColor is just missed!</span></div><div><div>The code is absolutely correct itself, it can be build and run.</div></div><div> </div><div>I'm using AST processing for code generation, so it is important for me to get  AST node for <span style="font-family:'courier new' , monospace">kernel_TestColor</span> and then analyze its arguments.</div><div>I understand that this seems to be not a bug, but ... may be, there is a way to make parser more tolerant to data types ... because what i actually need is just a strings of all parameters, so, just having "<span style="font-family:'courier new' , monospace">testData2.data()</span>" at some level of AST for the second parameter of <span style="font-family:'courier new' , monospace">kernel_TestColor would be enough for me</span>.</div><div> </div><div>I would be appretiate for help or advice.</div><div>Currently i use llvm 10.</div><div><div>Thanks!</div></div><div>-- </div><div>Best Regards,</div><div> Frolov V.A.</div><div> </div>