PR c++/51477 - ICE with invalid NSDMI

gcc/cp/

	PR c++/51477
	* search.c (lookup_member): Get out early on invalid base type.

gcc/testsuite/

	PR c++/51477
	* g++.dg/cpp0x/nsdmi6.C: New test.

From-SVN: r182474
This commit is contained in:
Dodji Seketeli 2011-12-19 09:47:46 +00:00 committed by Dodji Seketeli
parent fac665b24a
commit 7063212f9a
4 changed files with 21 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2011-12-19 Dodji Seketeli <dodji@redhat.com>
PR c++/51477
* search.c (lookup_member): Get out early on invalid base type.
2011-12-19 Jason Merrill <jason@redhat.com>
PR c++/51489

View File

@ -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);

View File

@ -1,3 +1,8 @@
2011-12-19 Dodji Seketeli <dodji@redhat.com>
PR c++/51477
* g++.dg/cpp0x/nsdmi6.C: New test.
2011-12-19 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/coarray_poly_3.f90: New.

View File

@ -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" }
};