Incorrect output from typePrinter

Hi,

I’m using clang libraries to parse the input code below.

I call getAsString on the QualType for the return value of Real::Get() and get:

Test2::Thing*

This is wrong, it should return:

Test2::ThingTest1::Zoo*

I’ve stepped through the typePrinter code. Test2::Thing is an elaborated type, and TypePrinter::printElaboratedBefore turns off the scope printing when it prints the template arguments. This results in Test1::Zoo being printed without any scope, hence the bug.

Is this a known issue and any thoughts on a workaround?

Sample code:

namespace Test1 { struct Zoo; }

namespace Test2 {

template
struct Thing {};

template
struct Base
{

virtual Test2::Thing* Get() = 0;
};

struct Real : public Base < Test1::Zoo >
{
};

}

Thanks,
-dan