On Oct 8, 2014, at 9:54 AM, Rob Springer <[email protected]> wrote:

> One question: ...getNumTemplateArguments and other functions depend on the 
> helper clang_Cursor_getTemplateArgument, which also has an unambiguous "bad" 
> return ("false"), so I've removed the asserts there, as well (or else 
> getNumTemplateArguments would still throw them). It seems like a shame, 
> though, to lose the debugging information that was captured in the assert 
> message ("Invalid template argument index", for example, in the prior patch 
> revision). Is there a convention to preserve that information somehow, or is 
> that not standard Clang practice?


See example of clang_Type_getSizeOf which returns different negative numbers 
for different kind of failure.

+ * If the argument CXCursor does not represent a FunctionDecl whose I'th
+ * template argument has a kind of ArgKind::Integral, an invalid type is\
+ * returned (in debug mode, this will assert).

This should mention 'CXTemplateArgumentKind_Integral' (not ArgKind::Integral) 
and it's not asserting now right ?

Otherwise, LGTM!

On Oct 8, 2014, at 4:07 PM, Rob Springer <[email protected]> wrote:

> Added some tests to index-templates.cpp; I can add more if necessary/desired 
> (...but I was having some difficulty getting more TemplateArgument::ArgKinds 
> to be expressed).
> 
> http://reviews.llvm.org/D5621
> 
> Files:
>  bindings/python/clang/cindex.py
>  bindings/python/tests/cindex/test_cursor.py
>  include/clang-c/Index.h
>  test/Index/index-templates.cpp
>  test/Index/preamble_macro_template.cpp
>  tools/c-index-test/c-index-test.c
>  tools/libclang/CXCursor.cpp
>  tools/libclang/libclang.exports
> <D5621.14606.patch>


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to