[LLVMbugs] [Bug 8767] New: show unimplemented methods in "abstract type" error

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Dec 9 17:20:44 PST 2010


           Summary: show unimplemented methods in "abstract type" error
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com

Clang could do a better job on this testcase:

  struct Base {
    virtual void NewPureMethod() = 0;
  struct Derived : public Base {
  void test() {
    new Derived;

What we get is ... pretty good actually:

  b3268147.cc:7:7: error: allocation of an object of abstract type 'Derived'
    new Derived;
  b3268147.cc:2:16: note: pure virtual function 'NewPureMethod'
    virtual void NewPureMethod() = 0;
  1 error generated.

What's interesting about the note is that it doesn't say what's wrong. Why yes,
that is a pure virtual function. What would be awesome is if it told us what to

How about:
  error: allocating type 'Derived' which is an abstract class
  note: unimplemented pure virtual method 'NewPureMethod' in 'Derived'

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