mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-24 08:50:26 +08:00
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>
|
||||
|
||||
PR bootstrap/51072
|
||||
|
@ -16448,6 +16448,9 @@ cp_parser_ptr_operator (cp_parser* parser,
|
||||
|
||||
if (TREE_CODE (parser->scope) == NAMESPACE_DECL)
|
||||
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
|
||||
{
|
||||
/* 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>
|
||||
|
||||
PR c++/51588
|
||||
* g++.dg/parse/enum7.C: New.
|
||||
|
||||
PR c++/51586
|
||||
* g++.dg/lookup/nested2.C: New.
|
||||
|
||||
|
9
gcc/testsuite/g++.dg/parse/enum7.C
Normal file
9
gcc/testsuite/g++.dg/parse/enum7.C
Normal file
@ -0,0 +1,9 @@
|
||||
// PR c++/51588
|
||||
|
||||
enum A {};
|
||||
|
||||
struct B : A { // { dg-error "" }
|
||||
int i;
|
||||
};
|
||||
|
||||
int A::* p = &B::i; // { dg-error "" }
|
Loading…
x
Reference in New Issue
Block a user