@@ -1171,7 +1171,9 @@ lookup_member (tree xbasetype, tree name, int protect, bool want_type,
const char *errstr = 0;
- if (name == error_mark_node)
+ if (name == error_mark_node
+ || xbasetype == NULL_TREE
+ || xbasetype == error_mark_node)
return NULL_TREE;
gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE);
new file mode 100644
@@ -0,0 +1,8 @@
+// Origin PR c++/51477
+// { dg-options "-std=c++11" }
+
+struct A
+{
+ typedef int int T; // { dg-error "two or more data types in declaration" }
+ struct T x[1] = { 0 }; // { dg-error "invalid|forward" }
+};