mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-25 05:30:25 +08:00
re PR c++/33558 ('mutable' incorrectly accepted on reference members)
2011-01-15 Giovanni Funchal <gafunchal@gmail.com> Jonathan Wakely <jwakely.gcc@gmail.com> PR c++/33558 * decl.c (grokdeclarator): Reject mutable reference members. Co-Authored-By: Jonathan Wakely <jwakely.gcc@gmail.com> From-SVN: r168843
This commit is contained in:
parent
050d1a59d1
commit
620437f2d4
@ -1,3 +1,9 @@
|
||||
2011-01-15 Giovanni Funchal <gafunchal@gmail.com>
|
||||
Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
|
||||
PR c++/33558
|
||||
* decl.c (grokdeclarator): Reject mutable reference members.
|
||||
|
||||
2011-01-14 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/47289
|
||||
|
@ -9214,6 +9214,12 @@ grokdeclarator (const cp_declarator *declarator,
|
||||
error ("const %qs cannot be declared %<mutable%>", name);
|
||||
storage_class = sc_none;
|
||||
}
|
||||
else if (TREE_CODE (type) == REFERENCE_TYPE)
|
||||
{
|
||||
permerror (input_location, "reference %qs cannot be declared "
|
||||
"%<mutable%>", name);
|
||||
storage_class = sc_none;
|
||||
}
|
||||
}
|
||||
|
||||
/* If this is declaring a typedef name, return a TYPE_DECL. */
|
||||
|
@ -1,3 +1,10 @@
|
||||
2011-01-15 Giovanni Funchal <gafunchal@gmail.com>
|
||||
Jonathan Wakely <jwakely.gcc@gmail.com>
|
||||
|
||||
PR c++/33558
|
||||
* g++.dg/other/pr33558.C: New.
|
||||
* g++.dg/other/pr33558-2.C: New.
|
||||
|
||||
2011-01-14 Martin Jambor <mjambor@suse.cz>
|
||||
|
||||
PR tree-optimization/45934
|
||||
|
6
gcc/testsuite/g++.dg/other/pr33558-2.C
Normal file
6
gcc/testsuite/g++.dg/other/pr33558-2.C
Normal file
@ -0,0 +1,6 @@
|
||||
/* { dg-do compile } */
|
||||
/* { dg-options "-fpermissive" } */
|
||||
|
||||
class X {
|
||||
mutable int &q; /* { dg-warning "cannot be declared 'mutable'" } */
|
||||
};
|
5
gcc/testsuite/g++.dg/other/pr33558.C
Normal file
5
gcc/testsuite/g++.dg/other/pr33558.C
Normal file
@ -0,0 +1,5 @@
|
||||
/* { dg-do compile } */
|
||||
|
||||
class X {
|
||||
mutable int &q; /* { dg-error "cannot be declared 'mutable'" } */
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user