Commit 8895d9a1 by Paolo Carlini

class.c (check_for_override): Wrap the 'final' and 'override' keywords in %< and %>.

/cp
2014-07-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* class.c (check_for_override): Wrap the 'final' and 'override'
	keywords in %< and %>.

/testsuite
2014-07-07  Paolo Carlini  <paolo.carlini@oracle.com>

	* g++.dg/cpp0x/override1.C: Tweak expected error messages.

From-SVN: r212333
parent 0f05a199
2014-07-07 Paolo Carlini <paolo.carlini@oracle.com>
* class.c (check_for_override): Wrap the 'final' and 'override'
keywords in %< and %>.
2014-07-06 Marek Polacek <polacek@redhat.com>
PR c/6940
......
......@@ -2771,9 +2771,9 @@ check_for_override (tree decl, tree ctype)
TYPE_HAS_NONTRIVIAL_DESTRUCTOR (ctype) = true;
}
else if (DECL_FINAL_P (decl))
error ("%q+#D marked final, but is not virtual", decl);
error ("%q+#D marked %<final%>, but is not virtual", decl);
if (DECL_OVERRIDE_P (decl) && !overrides_found)
error ("%q+#D marked override, but does not override", decl);
error ("%q+#D marked %<override%>, but does not override", decl);
}
/* Warn about hidden virtual functions that are not overridden in t.
......
2014-06-24 Max Ostapenko <m.ostapenko@partner.samsung.com>
2014-07-07 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp0x/override1.C: Tweak expected error messages.
2014-07-07 Max Ostapenko <m.ostapenko@partner.samsung.com>
* c-c++-common/asan/no-redundant-instrumentation-9.c: New test.
......
......@@ -18,7 +18,7 @@ struct D : B
template <class T> struct D2 : T
{
void h() override {} // { dg-error "marked override, but does not override" }
void h() override {} // { dg-error "marked 'override', but does not override" }
};
template <class T> struct D3 : T
......@@ -38,14 +38,14 @@ struct B3
struct B4
{
void f() final {} // { dg-error "marked final, but is not virtual" }
void f() final {} // { dg-error "marked 'final', but is not virtual" }
};
struct D5 : B
{
void ff() override {} // { dg-error "marked override, but does not override" }
virtual void fff() override {} // { dg-error "marked override, but does not override" }
virtual void x() override {} // { dg-error "marked override, but does not override" }
void ff() override {} // { dg-error "marked 'override', but does not override" }
virtual void fff() override {} // { dg-error "marked 'override', but does not override" }
virtual void x() override {} // { dg-error "marked 'override', but does not override" }
void g() override;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment