This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

[patch 2/3] Template Lookup


Patch 1 in this series introduced a pseudo-regression. If the symbol table contained:

foo<int>(int)
foo<char>(char)
Bar<int>
Bar<char>

and the user did:

(gdb) print foo
or
(gdb) ptype Bar

they would get the results for an arbitrary match of foo and Bar where previously the would just get a "symbol not found" error just because template lookup did not work properly.

This patch corrects that by introducing a meta variable representing the template into the scope of the template instance. This symbol is a place holder until overload resolution, but if the user tries to evaluate it or print its type they receive an appropriate error message:

"Symbol represents a template and cannot be evaluated."
"type = Template Symbol"

respectively.

Attachment: template_lookup_2.patch
Description: Text document


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