clang -ast-print-xml

I found an issue with the AST xml output.

Simple example:

class test {
public:
void doSomething() {
int i = 99;
}
};

clang -cc1 -ast-print-xml test.cpp

The resulting output doesn’t have any reference to the implementation doSomething()
If you implement it outside the deceleration it works fine.

class test {
public:
void doSomething();
};

void test::doSomething() {
int i = 99;
}

You get the correct tag.

Brad LaFountain schrieb:

I found an issue with the AST xml output.

Simple example:

class test {
public:
void doSomething() {
int i = 99;
}
};

clang -cc1 -ast-print-xml test.cpp

The resulting output doesn't have any reference to the implementation doSomething()

The problem is that when I developed the xml output 9 month ago I never had C++ in mind.
Neither it was my main focus nor it was the main focus of clang at that time.
Obvisiously the development has overrun me.
Anyway, attached there is a patch attached solving at least your issue.
Note that you now get all these implicit C++ methods too. However there are
still a lot of C++ things missing. And I don't even want to start thinking about C++0x.
It would be nice if someone could commit the patch.

Best Olaf

xml_patch.patch (3.2 KB)

Committed as r97954.

  - Doug