[PATCH] D76801: [AST] Print a<b<c>> without extra spaces in C++11 or later.

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 20 15:46:02 PDT 2020


dblaikie added a comment.

In D76801#1991904 <https://reviews.llvm.org/D76801#1991904>, @labath wrote:

> David's example does work with gdb without -Wl,--gdb-index (the member variable is shown), presumably due to the aforementioned fuzzy matching. However, it does not work if gdb-index is enabled,  nor with lldb (as lldb is always very index-oriented and assumes equality everywhere). That is definitely not ideal, though I'm not sure that means about this patch. This is definitely not the only difference in the formatting of DW_AT_names of templates. For example, `template<typename T> operator<<(T, T)` will come out as `operator<< <A>` with gcc, but as `operator<<<A>` with clang (with or without this patch).
>  OTOH, differences in type names are more likely to cause problems than is the case for functions/operators.


That is concerning. Any idea if that's only with lld's gdb-indexx implementation, or also gold's? This isn't the only naming divergence between GCC and Clang, though, so if gdb-index doesn't support any divergence, that's a problem... (I think non-type template parameters diverge too, perhaps? well, GCC 6 used to print "foo<3u>" (for an unsigned non-type template parameter) and clang/more recent GCC versions just use "foo<3>" now, for instance - enums, GCC uses foo<(EnumType)0> whereas Clang uses foo<enumeratorName> if it's named and foo<3> if it's unnamed))

Differences in function names could manifest as differences in type names - due to local types nested inside functions, but they're less likely/highly unlikely to have a decl/def resolution between CUs, so maybe nested types are less problematic.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76801/new/

https://reviews.llvm.org/D76801





More information about the cfe-commits mailing list