PR19341 shows that if a template parameter is a pointer to something
(variable, function, pointer-to-member) that is declared but not
defined, and also isn't used within the body of the template, then the 
generated code will not emit any reference to the thing but the debug
info will create such a reference (trying to describe its location).
This patch doesn't describe the location unless the template parameter
is actually used within the template.

The patch looks bigger than it really is because a chunk of code now
gets wrapped in an if statement, and just gets indented.

For the test, I had to add uses of some existing template parameters
so the references would be created properly, then I added a another 
template to show that without any uses there won't be a location.
Thanks,
--paulr

Attachment: dbg-tmpl-uses.diff
Description: dbg-tmpl-uses.diff

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to