Stakoverflow exception while parsing clang test file p2-0x.cpp with clang frontend.


I have written a custom RecursiveASTVisitor class according to the following link.

Now I am giving clang source code to my frontend tool for analysis.

The problem is for the test case


From the documentation of this test case, It is for undefined behaviour.

But clang can generate its AST.

And while running ClangTool on this test it throws stackoverflow exception even before the control comes in HandleTranslationUnit.

I am really very confused about the control flow and why this exception is coming.

Is this the expected behaviour. Then how to traverse the generated AST and visit the nodes.


Hemant Bhagat