Community
Participate
Working Groups
In the following code: template <int N> struct meta { static const int value = N; }; template <int A, int B = meta<A>::value> struct waldo {}; int main() { auto x = waldo</* invoke content assist here */ } if content assist is invoked at the indicated location, a hover appears showing the template arguments of "waldo". The hover reads: int A, int B = 74 0 value 14 meta 1 10 3 A 0 Notice how for the default argument of B, what is printed is a jumble of numbers and symbols. This is an instance of an internal string representation of the value, designed for purposes such as uniquely representing the argument for caching, leaking into the user interface. We should be pretty-printing the dependent expression instead.
(In reply to Nathan Ridge from comment #0) > This is an instance of an internal string representation of the value, > designed for purposes such as uniquely representing the argument for > caching, leaking into the user interface. This can happen in contexts outside of content-assist as well. For example, in this slightly modified code example: template <int N> struct meta { static const int value = N; }; template <int A, int B = meta<A>::value> struct waldo {}; template <typename T> void foo() { auto x = waldo<T>{}; } if you hover over the "auto", you get a hover that reads: 78 14 waldo 2 #0 10 103 129 5 74 0 value 14 meta 1 10 3 #0 0 0 Yikes!