re PR c++/28054 (ICE with friend declaration of invalid bitfield)

PR c++/28054
	* decl2.c (grokbitfield): Remove check for grokdeclarator
	returning NULL_TREE, instead check for error_mark_node
	to indicate failure.
	* decl.c (grokdeclarator): Adjust block comment.

	* g++.dg/other/incomplete3.C: New test.


Co-Authored-By: Mark Mitchell <mark@codesourcery.com>

From-SVN: r114986
This commit is contained in:
Lee Millward 2006-06-25 11:28:01 +00:00 committed by Lee Millward
parent 0fdc23b94d
commit 344f237baf
5 changed files with 28 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2006-06-25 Lee Millward <lee.millward@gmail.com>
Mark Mitchell <mark@codesuorcery.com>
PR c++/28054
* decl2.c (grokbitfied): Remove check for grokdeclarator
returning NULL_TREE, instead check for error_mark_node
to indicate failure.
* decl.c (grokdeclarator): Adjust block comment.
2006-06-25 Lee Millward <lee.millward@gmail.com>
PR c++/28051

View File

@ -6812,7 +6812,11 @@ check_var_type (tree identifier, tree type)
void S::f() { ... }
when grokdeclarator is called for `S::f', the CURRENT_CLASS_TYPE
should not be `S'. */
should not be `S'.
Returns a DECL (if a declarator is present), a TYPE (if there is no
declarator, in cases like "struct S;"), or the ERROR_MARK_NODE if an
error occurs. */
tree
grokdeclarator (const cp_declarator *declarator,

View File

@ -944,7 +944,8 @@ grokbitfield (const cp_declarator *declarator,
{
tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, NULL);
if (! value) return NULL_TREE; /* friends went bad. */
if (value == error_mark_node)
return NULL_TREE; /* friends went bad. */
/* Pass friendly classes back. */
if (TREE_CODE (value) == VOID_TYPE)

View File

@ -2,6 +2,9 @@
PR c++/28051
* g++.dg/template/using13.C: New test.
PR c++/28054
* g++.dg/other/incomplete3.C: New test.
2006-06-24 Francois-Xavier Coudert <coudert@clipper.ens.fr>

View File

@ -0,0 +1,9 @@
//PR c++/28054
struct A;
struct B
{
friend A : 2; // { dg-error "incomplete type" }
};