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

            Bug ID: 22582
           Summary: -Winconsistent-missing-override fires on class
                    templates with dependent bases
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++11
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected]
    Classification: Unclassified

We probably shouldn't warn for the code below (since some bases might not have
a virtual func() function, so override might not be suitable there).

$ cat over.cpp
struct base {
  virtual ~base();
  virtual void func();
};

template<typename T>
struct derived: T {
  void func();
  ~derived() override;
};

derived<base> d;
$ clang++-tot -Winconsistent-missing-override -fsyntax-only over.cpp -std=c++11
over.cpp:8:8: warning: 'func' overrides a member function but is not marked
'override' [-Winconsistent-missing-override]
  void func();
       ^
over.cpp:12:15: note: in instantiation of template class 'derived<base>'
requested here
derived<base> d;
              ^
over.cpp:3:16: note: overridden virtual function is here
  virtual void func();
               ^
1 warning generated.

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