typeck.c (lookup_anon_field): Cope with qv qualifiers.

cp/
	* typeck.c (lookup_anon_field): Cope with qv qualifiers.
testsuite/
	* g++.old-deja/g++.other/anon5.C: New test.

From-SVN: r37478
This commit is contained in:
Nathan Sidwell 2000-11-15 11:59:07 +00:00 committed by Nathan Sidwell
parent eab0c1ab23
commit 71631a1f1c
4 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2000-11-15 Nathan Sidwell <nathan@codesourcery.com>
* typeck.c (lookup_anon_field): Cope with qv qualifiers.
2000-11-14 Mark Mitchell <mark@codesourcery.com>
* class.c (build_vtbl_initializer): Fix typo in comment.

View File

@ -1994,7 +1994,7 @@ lookup_anon_field (t, type)
/* If we find it directly, return the field. */
if (DECL_NAME (field) == NULL_TREE
&& type == TREE_TYPE (field))
&& type == TYPE_MAIN_VARIANT (TREE_TYPE (field)))
{
return field;
}

View File

@ -1,3 +1,7 @@
2000-11-15 Nathan Sidwell <nathan@codesourcery.com>
* g++.old-deja/g++.other/anon5.C: New test.
2000-11-14 Joseph S. Myers <jsm28@cam.ac.uk>
* gcc.dg/c90-const-expr-2.c, gcc.dg/c99-const-expr-2.c: Add more

View File

@ -0,0 +1,17 @@
// Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 14 Nov 2000 <nathan@codesourcery.com>
// Bug 649. A cv qualified anonymous union would cause confusion.
struct X
{
int fn () const
{
return member;
}
const union
{
int member;
};
};