Patch: clang_CXXMethod_isVirtual


Attached is a patch which adds the “clang_CXXMethod_isVirtual” to libclang. It is (very) similar to clang_CXXMethod_isStatic.

I tried to add test-cases, but I could not find any for clang_CXXMethod_isStatic. So, are they needed, and if so, is there an example I can use?


cxx-is-virtual.patch (1.48 KB)

Usually, we teach c-index-test to query this information and print it out, so that we can check for that output in one of the test/Index/* tests.

But, your patch looks good. I've committed it as r131230, with the addition of this function to the two "exports" files in tools/libclang. Thanks!

  - Doug

Ok, did that for both static and virtual methods, and fixed the tests where static or virtual methods now show up.

Note on the c-index-test change: “(static)” or “(virtual)” will show up in the same way as “[Overrides” does, so on any token in of the method declaration/definition.

– Erik.

static-virtual-method-tests.patch (10.2 KB)

Committed in r131295, thanks!

  - Doug