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

             Bug #: 13890
           Summary: Final abstract classes should generate warnings
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C++11
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified


class Animal {
  virtual void print() const = 0;
};
class Dog final : public Animal {
};

In this code, i would expect a compiler warning as Dog is final, but is still
abstract as it didn't implement a print method.  Its also possible to put final
on Animal itself which doesn't really make sense as then Animal is an abstract
class which cannot be implemented by anyone.

-Wall doesn't show anything for this test.  -Weverything does, but the messages
aren't related to this:

cpp11.cpp:1:7: warning: 'Animal' has virtual functions but non-virtual
      destructor [-Wnon-virtual-dtor]
class Animal {
      ^
cpp11.cpp:4:11: warning: 'final' keyword is incompatible with C++98
      [-Wc++98-compat]
class Dog final : public Animal {
          ^
cpp11.cpp:4:7: warning: 'Dog' has virtual functions but non-virtual destructor
      [-Wnon-virtual-dtor]
class Dog final : public Animal {

-- 
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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to