Hey,

I've noticed that evaluating expressions involving templated classes seems
to have some unexpected behavior.

I've created the following sample code to reproduce the issue:

template <typename T> class foo
{
  uint32_t data;
};

foo<int> test;

int main() {
  foo<void> test2;
  return 0;
}

I've set a breakpoint on main and evaluated the following expressions:
(lldb) p sizeof(foo<void>)
(unsigned long) $0 = 4
(lldb) p sizeof(foo<int>)
error: implicit instantiation of undefined template 'foo<int>'
template is declared here

It seems like expression evaluation can only find the specialized templated
classes that were used in the current scope. Running the same example using
GDB works as expected (both expressions are evaluated correctly).

Is this a known issue?
Does anybody have any insight, or familiarity with expression
evaluation that would be able to point me in the right direction?

Thanks,
Scott
_______________________________________________
lldb-dev mailing list
lldb-dev@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev

Reply via email to