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

            Bug ID: 30937
           Summary: Can't find pure virtual function after r285954
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: dma...@mozilla.com
                CC: llvm-bugs@lists.llvm.org, richard-l...@metafoo.co.uk
    Classification: Unclassified

$ cat test.cpp
struct NormalizedConstraintSet
{
  struct BaseRange
  {
    virtual void FinalizeMerge() = 0;
  };

  struct StringRange : public BaseRange
  {
    void FinalizeMerge() override {}
  };

  NormalizedConstraintSet();
};

NormalizedConstraintSet::NormalizedConstraintSet()
{
  typedef BaseRange NormalizedConstraintSet::* MemberPtrType;
  MemberPtrType list[42];

  for (auto& memberPtr : list) {
    (this->*memberPtr).FinalizeMerge();
  }
}

int main()
{
  return 0;
}

$ clang-cl test.cpp
test-24ac86.obj : error LNK2019: unresolved external symbol "public: virtual
void __cdecl NormalizedConstraintSet::BaseRange::FinalizeMerge(void)"
(?FinalizeMerge@BaseRange@NormalizedConstraintSet@@UEAAXXZ) referenced in
function "public: __cdecl
NormalizedConstraintSet::NormalizedConstraintSet(void)"
(??0NormalizedConstraintSet@@QEAA@XZ)
test.exe : fatal error LNK1120: 1 unresolved externals
clang-cl.exe: error: linker command failed with exit code 1120 (use -v to see
invocation)

(This test.cpp was reduced from the Firefox codebase. For real-world usage
please see https://dxr.mozilla.org/mozilla-central/search?q=FinalizeMerge)

-- 
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