diff options
author | Jason Merrill <jason@redhat.com> | 2014-09-22 15:22:37 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2014-09-22 15:22:37 -0400 |
commit | 6863c41a15ac58554cd413c1dcde9f43d9dba4c0 (patch) | |
tree | 55293012afed93cc887dd441e91cd85b8989baab /gcc/cp | |
parent | a546927c6a9a06b25ae85f8206b2c7afc53f4a45 (diff) | |
download | gcc-6863c41a15ac58554cd413c1dcde9f43d9dba4c0.zip gcc-6863c41a15ac58554cd413c1dcde9f43d9dba4c0.tar.gz gcc-6863c41a15ac58554cd413c1dcde9f43d9dba4c0.tar.bz2 |
semantics.c (finish_non_static_data_member): In diagnostic, give error at point of use and note at point of declaration.
* semantics.c (finish_non_static_data_member): In diagnostic, give
error at point of use and note at point of declaration.
From-SVN: r215479
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f209e15..d6db39f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2014-09-22 Jason Merrill <jason@redhat.com> + * semantics.c (finish_non_static_data_member): In diagnostic, give + error at point of use and note at point of declaration. + PR c++/63320 PR c++/60463 PR c++/60755 diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 1d81028..6e04e5e 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1692,10 +1692,10 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope) { if (current_function_decl && DECL_STATIC_FUNCTION_P (current_function_decl)) - error ("invalid use of member %q+D in static member function", decl); + error ("invalid use of member %qD in static member function", decl); else - error ("invalid use of non-static data member %q+D", decl); - error ("from this location"); + error ("invalid use of non-static data member %qD", decl); + inform (DECL_SOURCE_LOCATION (decl), "declared here"); return error_mark_node; } |