https://bugs.llvm.org/show_bug.cgi?id=36745

            Bug ID: 36745
           Summary: Debug info for variadic templates
           Product: clang
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
          Assignee: unassignedclangb...@nondot.org
          Reporter: kiranchandramo...@gmail.com
                CC: dgre...@apple.com, llvm-bugs@lists.llvm.org

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...);

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to