Improve error for "override" + non-virtual func.
Consider something like the following: struct X { virtual void foo(float x); }; struct Y : X { void foo(double x) override; }; The error is almost certainly that Y::foo() has the wrong signature, rather than incorrect usage of the override keyword. This patch adds an appropriate diagnostic for that case. Fixes <rdar://problem/14785106>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190109 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Basic/DiagnosticSemaKinds.td 3 additions, 0 deletionsinclude/clang/Basic/DiagnosticSemaKinds.td
- include/clang/Sema/Sema.h 6 additions, 2 deletionsinclude/clang/Sema/Sema.h
- lib/Sema/SemaDeclCXX.cpp 77 additions, 34 deletionslib/Sema/SemaDeclCXX.cpp
- test/CXX/class.derived/class.virtual/p3-0x.cpp 20 additions, 0 deletionstest/CXX/class.derived/class.virtual/p3-0x.cpp
Loading
Please register or sign in to comment