diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2015-06-22 17:35:34 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-06-22 17:35:34 +0000 |
commit | ea663be91a23f217308e669e76b4f0a0c7b86616 (patch) | |
tree | cc0516ef0b5bb982519291a1fe8f3085d72e8533 /gcc/cp | |
parent | 33273def7cd81f32d5e5fb9d06e7f5794cb2d46a (diff) | |
download | gcc-ea663be91a23f217308e669e76b4f0a0c7b86616.zip gcc-ea663be91a23f217308e669e76b4f0a0c7b86616.tar.gz gcc-ea663be91a23f217308e669e76b4f0a0c7b86616.tar.bz2 |
decl.c (grokdeclarator): Use declspecs->locations[ds_virtual].
/cp
2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use declspecs->locations[ds_virtual].
/testsuite
2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/inherit/pure1.C: Test location too.
2015-06-22 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Remove pointless code.
From-SVN: r224750
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/cp/decl.c | 13 |
2 files changed, 11 insertions, 10 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9f4e8b2..89e4373 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2015-06-22 Paolo Carlini <paolo.carlini@oracle.com> + + * decl.c (grokdeclarator): Use declspecs->locations[ds_virtual]. + +2015-06-22 Paolo Carlini <paolo.carlini@oracle.com> + + * decl.c (grokdeclarator): Remove pointless code. + 2015-06-22 Jason Merrill <jason@redhat.com> PR c++/66515 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 515c2d3..c934ff9 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -9529,7 +9529,8 @@ grokdeclarator (const cp_declarator *declarator, if (virtualp && (current_class_name == NULL_TREE || decl_context != FIELD)) { - error ("%<virtual%> outside class declaration"); + error_at (declspecs->locations[ds_virtual], + "%<virtual%> outside class declaration"); virtualp = 0; } @@ -10476,19 +10477,11 @@ grokdeclarator (const cp_declarator *declarator, if (decl_context == TYPENAME) { - /* Note that the grammar rejects storage classes - in typenames, fields or parameters. */ - if (type_quals != TYPE_UNQUALIFIED) - type_quals = TYPE_UNQUALIFIED; + /* Note that here we don't care about type_quals. */ /* Special case: "friend class foo" looks like a TYPENAME context. */ if (friendp) { - if (type_quals != TYPE_UNQUALIFIED) - { - error ("type qualifiers specified for friend class declaration"); - type_quals = TYPE_UNQUALIFIED; - } if (inlinep) { error ("%<inline%> specified for friend class declaration"); |