Issue 130411.1: Values for non-type template parameter

Author: Paul Robinson
Champion: Paul Robinson
Date submitted: 2013-04-11
Date revised:
Date closed:
Type: Clarification
Status: Replaced
DWARF Version: 5
Section 5.5.8, pg 93
Currently, DW_TAG_template_value_parameter has a DW_AT_const_value attribute giving the
constant value of the actual parameter used to instantiate the template.

However, "value parameter" doesn't adequately describe what are actually "non-type"
parameters.  DW_AT_const_value really handles only integral/enumerated parameters;
more complex non-type parameters need something more appropriate.

I tried the following with GCC 4.7.2:

template <int X> struct A { int a; };
template <int &Y> struct B { int b; };
template <int Z(int)> struct C { int c; };
int i = 0;
int foo(int j) { return 2 * j; }
A<4> instanceA;
B<&i> instanceB;
C<foo> instanceC;

It produces DW_AT_const_value in the type tag for instanceA, and uses DW_AT_location 
for the other two.  We should probably bless this usage.

---
Replace by 130412.1