re PR c++/65954 (gcc segfaults on the following input with a syntax error)
cp/ PR c++/65954 * typeck.c (finish_class_member_access_expr): Diagnose failed lookup of enum class member. testsuite/ * g++.dg/cpp0x/pr65954.C: New. From-SVN: r223430
This commit is contained in:
parent
261640d521
commit
09b59d4de6
@ -1,3 +1,9 @@
|
||||
2015-05-19 Nathan sidwell <nathan@acm.org>
|
||||
|
||||
PR c++/65954
|
||||
* typeck.c (finish_class_member_access_expr): Diagnose failed
|
||||
lookup of enum class member.
|
||||
|
||||
2015-05-19 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR middle-end/66199
|
||||
|
@ -2731,6 +2731,14 @@ finish_class_member_access_expr (tree object, tree name, bool template_p,
|
||||
return error_mark_node;
|
||||
}
|
||||
tree val = lookup_enumerator (scope, name);
|
||||
if (!val)
|
||||
{
|
||||
if (complain & tf_error)
|
||||
error ("%qD is not a member of %qD",
|
||||
name, scope);
|
||||
return error_mark_node;
|
||||
}
|
||||
|
||||
if (TREE_SIDE_EFFECTS (object))
|
||||
val = build2 (COMPOUND_EXPR, TREE_TYPE (val), object, val);
|
||||
return val;
|
||||
|
@ -1,3 +1,7 @@
|
||||
2015-05-19 Nathan sidwell <nathan@acm.org>
|
||||
|
||||
* g++.dg/cpp0x/pr65954.C: New.
|
||||
|
||||
2015-05-20 Oleg Endo <olegendo@gcc.gnu.org>
|
||||
|
||||
* gcc.target/sh/pr64366.c: Remove -m4 -ml from dg-options.
|
||||
|
12
gcc/testsuite/g++.dg/cpp0x/pr65954.C
Normal file
12
gcc/testsuite/g++.dg/cpp0x/pr65954.C
Normal file
@ -0,0 +1,12 @@
|
||||
// { dg-do compile { target c++11 } }
|
||||
|
||||
struct Shape {
|
||||
enum class Type
|
||||
{ Circle, Square };
|
||||
};
|
||||
|
||||
|
||||
void Foo (Shape &shape)
|
||||
{
|
||||
+shape.Type::NOPE; // { dg-error "is not a member of" }
|
||||
}
|
Loading…
Reference in New Issue
Block a user