[Bug 49368] New: main::Class vs. Class not found for inferior calls

Bug ID 49368
Summary main::Class vs. Class not found for inferior calls
Product lldb
Version unspecified
Hardware PC
OS Linux
Status NEW
Severity normal
Priority P
Component All Bugs
Assignee lldb-dev@lists.llvm.org
Reporter jan.kratochvil@redhat.com
CC jdevlieghere@apple.com, llvm-bugs@lists.llvm.org

template<class T> class D {
public:
  T t;
  T &m() {
    return t;
  }
};
int main() {
  struct C { unsigned i = 42; };
  D<C> d;
  return d.m().i; // breakpoint
}

(lldb) p d.m()
error: error: function 'D<C>::m' is used but not defined in this translation
unit, and cannot be defined in any other translation unit because its type does
not have linkage
<user expression 0>:1:3: used here
d.m()
  ^
$ llvm-nm -C a.out
0000000000401160 t D<main::C>::m()

(gdb) p d.m()
$1 = (C &) @0x7fffffffcf58: {i = 42}