mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/51588 ([c++0x] [4.4/4.5/4.6/4.7 Regression] ICE using an enum as base class)
PR c++/51588 * parser.c (cp_parser_ptr_operator): Reject pointer to member of enum. From-SVN: r182452
This commit is contained in:
parent
de4d7a7f8d
commit
55f8ed9685
|
@ -1,3 +1,8 @@
|
||||||
|
2011-12-17 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/51588
|
||||||
|
* parser.c (cp_parser_ptr_operator): Reject pointer to member of enum.
|
||||||
|
|
||||||
2011-12-17 Richard Henderson <rth@redhat.com>
|
2011-12-17 Richard Henderson <rth@redhat.com>
|
||||||
|
|
||||||
PR bootstrap/51072
|
PR bootstrap/51072
|
||||||
|
|
|
@ -16448,6 +16448,9 @@ cp_parser_ptr_operator (cp_parser* parser,
|
||||||
|
|
||||||
if (TREE_CODE (parser->scope) == NAMESPACE_DECL)
|
if (TREE_CODE (parser->scope) == NAMESPACE_DECL)
|
||||||
error_at (token->location, "%qD is a namespace", parser->scope);
|
error_at (token->location, "%qD is a namespace", parser->scope);
|
||||||
|
else if (TREE_CODE (parser->scope) == ENUMERAL_TYPE)
|
||||||
|
error_at (token->location, "cannot form pointer to member of "
|
||||||
|
"non-class %q#T", parser->scope);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* The type of which the member is a member is given by the
|
/* The type of which the member is a member is given by the
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
2011-12-17 Jason Merrill <jason@redhat.com>
|
2011-12-17 Jason Merrill <jason@redhat.com>
|
||||||
|
|
||||||
|
PR c++/51588
|
||||||
|
* g++.dg/parse/enum7.C: New.
|
||||||
|
|
||||||
PR c++/51586
|
PR c++/51586
|
||||||
* g++.dg/lookup/nested2.C: New.
|
* g++.dg/lookup/nested2.C: New.
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
// PR c++/51588
|
||||||
|
|
||||||
|
enum A {};
|
||||||
|
|
||||||
|
struct B : A { // { dg-error "" }
|
||||||
|
int i;
|
||||||
|
};
|
||||||
|
|
||||||
|
int A::* p = &B::i; // { dg-error "" }
|
Loading…
Reference in New Issue