This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/68842] New: Better error output when template needed before dependent name


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

            Bug ID: 68842
           Summary: Better error output when template needed before
                    dependent name
           Product: gcc
           Version: 4.8.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: davejohansen at gmail dot com
  Target Milestone: ---

Created attachment 36985
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36985&action=edit
Example code to demonstrate error

Currently, when a dependent name cannot be correctly resolved and the template
keyword is required, the error output is:
test_template.cc: In instantiation of âvoid do_test() [with int N = 2]â:
test_template.cc:20:14:   required from here
test_template.cc:15:15: error: invalid operands of types â<unresolved
overloaded function type>â and âintâ to binary âoperator<â
   t.do_nothing<N>(0);

The output is a correct representation of how the compiler is interpreting the
code, but it is not helpful to a developer that doesn't understand the
intricacies of templates and dependent name resolution. It would be nice if a
more meaningful error output was given with at least a hint about the possible
need for the template keyword.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]