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

            Bug ID: 25258
           Summary: -Wnon-virtual-dtor should not trigger if the base
                    class has a protected destructor
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]
    Classification: Unclassified

struct A { virtual void a(); protected: ~A() = default; };
struct B : public A { void a() override; };

/tmp/t.cc:2:8: warning: 'B' has virtual functions but non-virtual destructor
[-Wnon-virtual-dtor]
struct B : public A { void a() override; };
       ^
1 warning generated.

As there is no way to destruct a B object through an A pointer, this should be
allowed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to