https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84917

            Bug ID: 84917
           Summary: Verbosity when dealing with nested template data
                    structures
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

In
https://www.reddit.com/r/programming/comments/84oizv/usability_improvements_in_gcc_8/dvsa8dw/
Reddit user "rifeid" reports excess verbosity...

> [...] when dealing with nested template data structures. For example,

#include <string>
#include <vector>
using vec = std::vector<std::string>;
void blah() {
    vec x;
    x.foo();
}

> results in

test.cpp: In function ‘void blah()’:
test.cpp:6:4: error: ‘using vec = class
std::vector<std::__cxx11::basic_string<char> > {aka class
std::vector<std::__cxx11::basic_string<char> >}’ has no member named ‘foo’
  x.foo();
    ^~~

> My issues with this:
>
> It may look better if the error: line just uses vec, and
> have the full expansion relegated to a note: line. Not sure.
>
> The expansion is printed twice.
>
> As std::string is part of the C++ standard, I'd prefer it unexpanded.

Confirmed on godbolt.org.

I think parts of these are a dup (maybe of PR c++/84360) but it seems worth
capturing here and fixing.

Reply via email to