[LLVMbugs] [Bug 9117] New: Chromium build broken after r124565

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Feb 1 09:25:46 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=9117

           Summary: Chromium build broken after r124565
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: hans at chromium.org
                CC: llvmbugs at cs.uiuc.edu


r124565 changed something related to inlining and virtual functions, which
breaks compilation of Chromium/WebKit.


Test case:

template<typename T> void derefIfNotNull(T* ptr) {
  ptr->deref();
}

template<typename T> class RefPtr {
 public:
  RefPtr() : m_ptr(0) {}

  ~RefPtr() {
    derefIfNotNull(m_ptr);
  }

 private:
  T* m_ptr;
};

class Node;

class BaseWithVirtualDtor {
 public:
  virtual ~BaseWithVirtualDtor() {}
};

class MyClass : public BaseWithVirtualDtor {
 public:
  virtual void doStuff() const;

 private:
  RefPtr<Node> m_base;
};

void f(MyClass* x) {
  x->doStuff();
}

Error:

$ ./clang++ -c /tmp/a.cc
/tmp/a.cc:2:6: error: member access into incomplete type 'Node'
  ptr->deref();
     ^
/tmp/a.cc:10:5: note: in instantiation of function template specialization
      'derefIfNotNull<Node>' requested here
    derefIfNotNull(m_ptr);
    ^
/tmp/a.cc:24:7: note: in instantiation of member function
'RefPtr<Node>::~RefPtr'
      requested here
class MyClass : public BaseWithVirtualDtor {
      ^
/tmp/a.cc:17:7: note: forward declaration of 'Node'
class Node;
      ^
1 error generated.


Clang version:

$ ./clang++ --version
clang version 2.9 (trunk 124659)
Target: x86_64-unknown-linux-gnu
Thread model: posix

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list