]> granicus.if.org Git - clang/commit
Improve error for "override" + non-virtual func.
authorEli Friedman <eli.friedman@gmail.com>
Thu, 5 Sep 2013 23:51:03 +0000 (23:51 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Thu, 5 Sep 2013 23:51:03 +0000 (23:51 +0000)
commitdae9271c2c32527fea8b01953912e214eadc548e
treeae68cdcf06c19270ec18cc780895e8b610d174f2
parentedadb9a879e14b3732461316a83ffc4c3482ad19
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
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/Sema.h
lib/Sema/SemaDeclCXX.cpp
test/CXX/class.derived/class.virtual/p3-0x.cpp