[cfe-users] 3.8 indentation with -fdiagnostics-show-template-tree doesn't show tree

Larry Evans via cfe-users cfe-users at lists.llvm.org
Thu May 26 00:17:27 PDT 2016


On 05/24/2016 05:21 PM, Larry Evans via cfe-users wrote:
> On 05/24/2016 04:09 PM, Richard Trieu via cfe-users wrote:
>> Hi Larry,
>>
>> Right now, the template type diffing only works when there are two
>> templated types in the diagnostics message, and the templated types
>> share the same base.  It your first example, the two types are
>> vector<double> and vector<float>.
>>
>> In the second error message, only one type is printed with the
>> diagnostic message.  This does not trigger the template type diffing.
>> The first message is "no member named 'size' in <<very long type name>>"
>> and the second message is "in instantiation of function template
>> specialization <<long type name>> requested here"
>>
>> Richard
>>
> Thanks Richard.
>
> That's too bad.  It finally dawned on me that I might could use
> clang-format on the part of the error message I wanted indented.
> It worked:

OOPS.  I was very mistaken.  I jumped to the conclusion based
on only a brief look at the output which only seemed to
show tree-like indentation.  When I tried using
clang-format on the templed test.cpp, it showed no tree like output :(

I guess I could make a feature request for this type of tree-link
output in the clang diagnostic, a feature which I've wanted for
several years and I think would help people better understand
complicated template diagnostics.

Sorry for noise.

>
> ~/prog_dev/clang/libcxx/sandbox/libs/gram_stk/sandbox $ head test.cpp
> texpressions<my_symbols>::gram_defs<my_attrs,
>
> composite_storage::type_sequence<texpressions<my_symbols>::gram_def1<my_symbols<symb_kinds::varble_kind>::syms::varble0,
>
>        def_ops::def_act, composite_storage::top (),
> var_ptr_bool::var_ptr_yes,
>
> texpressions<my_symbols>::gram_expr<op_assoc<ops_non_nullary::op_bitor,
> associativity::assoc_left>,
>
> texpressions<my_symbols>::gram_expr<texpressions<my_symbols>::op_symb<symb_kinds::literl_kind,
>
>        my_symbols<symb_kinds::literl_kind>::syms::literl0>>,
>
> texpressions<my_symbols>::gram_expr<op_assoc<ops_non_nullary::op_bitand,
> associativity::assoc_left>,
>
> texpressions<my_symbols>::gram_expr<texpressions<my_symbols>::op_symb<symb_kinds::literl_kind,
>
>        my_symbols<symb_kinds::literl_kind>::syms::literl1>>,
>
> texpressions<my_symbols>::gram_expr<texpressions<my_symbols>::op_symb<symb_kinds::literl_kind,
>
> ~/prog_dev/clang/libcxx/sandbox/libs/gram_stk/sandbox $ clang-format
> test.cpp|head
> Can't find usable .clang-format, using LLVM style
> texpressions<my_symbols>::gram_defs<
>      my_attrs,
>      composite_storage::type_sequence<texpressions<my_symbols>::gram_def1<
>          my_symbols<symb_kinds::varble_kind>::syms::varble0,
> def_ops::def_act,
>          composite_storage::top(), var_ptr_bool::var_ptr_yes,
>          texpressions<my_symbols>::gram_expr<
>              op_assoc<ops_non_nullary::op_bitor,
> associativity::assoc_left>,
>              texpressions<my_symbols>::gram_expr<
>                  texpressions<my_symbols>::op_symb<
> ~/prog_dev/clang/libcxx/sandbox/libs/gram_stk/sandbox $
>
> Hope that helps others which have similar problem deciphering
> error messages ;)
>
> -regards,
> Larry
>
>
>
> _______________________________________________
> cfe-users mailing list
> cfe-users at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users





More information about the cfe-users mailing list