[PATCH] PR19341, debug-info refers to nonexistent object

Robinson, Paul Paul_Robinson at playstation.sony.com
Tue Apr 15 16:08:48 PDT 2014

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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbg-tmpl-uses.diff
Type: application/octet-stream
Size: 6735 bytes
Desc: dbg-tmpl-uses.diff
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140415/3e2d7fd7/attachment.obj>

More information about the cfe-commits mailing list