[LLVMbugs] [Bug 22582] New: -Winconsistent-missing-override fires on class templates with dependent bases

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 13 13:37:48 PST 2015


            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: unassignedclangbugs at nondot.org
          Reporter: dblaikie at gmail.com
                CC: dgregor at apple.com, fjahanian at apple.com,
                    llvmbugs at cs.uiuc.edu
    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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150213/e2c0b5c0/attachment.html>

More information about the llvm-bugs mailing list