<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Debug info for non-type template parameters lacks DW_AT_location depending on layout"
   href="http://llvm.org/bugs/show_bug.cgi?id=16967">16967</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Debug info for non-type template parameters lacks DW_AT_location depending on layout
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>david.majnemer@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>consider:
struct Type {
  unsigned int Data1;
  unsigned short Data2, Data3;
  unsigned char Data4;
};

template<const Type *G>
const Type *func() {
  return G;
}

extern const Type Y;
const Type Y = {};
int main() {
  func<&Y>();
}

compile with:
~/llvm/build/bin/clang /var/tmp/dlb.cpp -o /var/tmp/dlb -g

dwarfdump shows:
0x000000df:     DW_TAG_template_value_parameter [9]  
                  DW_AT_type [DW_FORM_ref4]     (cu + 0x00e9 => {0x000000e9})
                  DW_AT_name [DW_FORM_strp]     ( .debug_str[0x000000a7] = "G")

We are missing DW_AT_location

in the following gdb session:
Temporary breakpoint 1, main () at /var/tmp/dlb.cpp:15
15        func<&Y>();
(gdb) step
func<&Y> () at /var/tmp/dlb.cpp:9
9         return G;
(gdb) p G
$1 = <optimized out></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>