<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 variadic templates"
   href="https://bugs.llvm.org/show_bug.cgi?id=36745">36745</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Debug info for variadic templates
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>kiranchandramohan@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>template<typename T>
T accumulator(T v) {
  return v;
}

template<typename T, typename... Args>
T accumulator(T first, Args... args) {
  return first + accumulator(args...);
}

int main()
{
long sum = accumulator(1, 3, 5, 7);
return sum;
}

The testcase is given above. This testcase is an example for variadic
templates. The debug info generated for this testcase by clang seems to be
incorrect. The accumulator is passed the values (1,3,5,7). All the non-first
elements are shown with value 7 at the breakpoint. Ideally they should be
first=1, args=3, args=5, args=7

Breakpoint 2, accumulator<int, int, int, int> (first=1, args=7, args=7, args=7)
at simple_var.cpp:8
8         return first + accumulator(args...);</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>